Tweaks and test fixes