Tidy up tests.
Merged patient detection.