cleanup hooks, more tests