fix #11
add regression test
Merge branch 'KeenS-master'