Use "return" to terminate an algorithm. Fixes #35.