Fixed up DBI handle opening and closing