Some Database Implementation fixes