Fix for handling temporary files