Bug fixes for a couple unanswered bugs in the database