Fixed terrain code.