Debugging database class issues