Fix bug which caused an error if database connection was made manually by passing an array