Better error message for illegal files