fix part file handling and real size calculation, this should also solve #4581