added tests to fix #13