DB/Misc: Fix startup and runtime errors

By dr-j