Fix lazy loading of settings

Closes #3281

- Add the missing return to populateDefault
- Modify migrations.init to only load databaseVersion for export_spec test
- Fix spacing in test util file and null reference error in test