Bug and test fixes
Prepare fixes