fixed bug where reading a file would fail above 512 MB