Fixed issues with heightmaps and with static lastpos