Adding tests and fixing a bug with cloning

- Closes #2040
- Add basic testing
Would this be useful as a fixture file on its own?