Fix for terrain buffer index error (fixes #18)