fix #5
fix tests
fix #6