Fix bug in calculating ideal sizes.