The code looks ok, but I can't confirm such a problem here. Maybe it's related to the used model, or terrain. Can you upload an example, or send it to Support? We'll look into this.