Fixed a bug that would always tell you the filename is invalid