Close the db properly. Remove some extra logging.