DB interfaces, lots of bugfixes