#667: reproduced in test
fixes and closes #667