Coastline-check code should now work.

Passes standalone self-tests.