Added tests and fixes for localstoragemanager