Fix #86. Add tests to check this issue