Fixed bugs in File reader