fixes #231; more test coverage