Bug fixed in determination of file type. File handler needs to point back to zero-byte for further reads.