Fix a minnor issue. Add tests.