Fix issue with wrong size calculation