Fixed database issues with test and dev and production