Fix #10 and add helper tests.