More fixes and tidy ups. Should be more coverage.