Fixing file type checking functions.