DB bugs fixed