More tests for store and fix some bugs