Adding tests and checks...

continued clean-ups