add and fix terrain get/set functions