Fix #105 + tests