Fix bug with copying file size larger than a page