test fixes and cleanup