Fix bug in database connector