Fixed some bugs which occured due to refactoring the dbobjects