making Firebird happy by properly closing all the stuff