More comments and error checking for DatabaseManager.