storage.js - fixes and improvements