Fix #113, all tests pass