Tweaks to previous work, making it all work (hopefully).