Fix #15 and add tests for it