Fix for height calculation