Fix for size calculation