Fix #23 with tests.