Fixed terrain collision bugs.