Fixing negative filesize bug