@1aurabrown => fix rebase + tests

There's no point in me asking for smaller PRs without offering some help to get started. This fixes all the issues I raised in your first PR, ensures tests pass and merges in changes since then.