Fix a few issues due to the database restructure

The database restructure messed a few things up.