Refactoring around tests - and working around port issues.