fix cache.increment, added tests
Merge pull request #502 from niphlod/fix/cache_and_tests

fix cache.increment, added tests