WIP: Better test coverage

Not ready for review/merge yet.