Tweaks and adding tests