Terrain server check

Fixes #317.

Merge #405 first