Fixed bugs with heightmaps