Index: trunk/xcache.c
===================================================================
--- trunk/xcache.c	(revision 957)
+++ trunk/xcache.c	(revision 960)
@@ -2731,10 +2731,10 @@
 	switch (optype) {
 		case XC_OP_COUNT:
-			RETURN_LONG(size)
+			RETURN_LONG(caches ? size : 0)
 			break;
 
 		case XC_OP_INFO:
 		case XC_OP_LIST:
-			if (id < 0 || id >= size) {
+			if (!caches || id < 0 || id >= size) {
 				php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cache not exists");
 				RETURN_FALSE;
@@ -2758,5 +2758,5 @@
 				int entryslotid, c;
 
-				if (id < 0 || id >= size) {
+				if (!caches || id < 0 || id >= size) {
 					php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cache not exists");
 					RETURN_FALSE;
@@ -2812,5 +2812,5 @@
 
 #define VAR_DISABLED_WARNING() do { \
-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "xcache.var_size is either 0 or too small to enable var data caching"); \
+		php_error_docref(NULL TSRMLS_CC, E_WARNING, "XCache var cache was not initialized properly. Check php log for actual reason"); \
 } while (0)
 
