CloseFile attempt to assist mpv with it's bug

Also updated the set functions to verify that they are not the same as was done in the last commit.