fixes to loki.js loading of old databases