Fixed bug for init terrain