Fixed OpenFileHandle and OpenDirHandle changes for OS X