better return from cachesize function, fixed compiler warnings on Windows