Fixed some bugs in heightmap