Fixed file type error handling