Bugfixes

Mostly to work with the new database structure and typos.