Remove debug code
Fix to close file