Reworked calculation of scale height.