Fix issue #268.

This is a PR to resolve #268 - not currently ready for merging.

Todo
----

- [x] Add failing tests
- [ ] Fix failing tests