Debugging. Added important raw_close that had been lost at some point.