Tweaks and better tests