Fixed #2 file handle issue.