Improve tests for #4, and fix fallout