Fixes for database upgrades
Merge pull request #248 from NielsZeilemaker/fix_database_upgrade

Fixes for database upgrades