Fixes for database class