More tweaks to database, fix more code first issues