check(FileInputStream) and test() run but return improper results