Removed a few bugs in the db file