add test
bug fixed (but too ad-hoc). close #2