Fixed Db issues