Fix height calculation