Fixed bug when encountering large file sizes.