fixes for database