DB, minor bugfixes