Bugfixes on DB