Fixed some DB reference initialization issues