Fixed some bugs and missing pieces with db saving to localStorage