Fixed proper disposal of SQL result sets.