Fix bug in size calculation.