Tweak to use getSize() instead of calling filesize() directly