test fixes, and some improves