Fix input file checking