tests and misc cleanup