Fixed some errors when initializing with empty stores.