Fixes an open file handle issue.