Unit tests
fix #116
fix #117