Tweaks to get mock connections to work (at least for publications, lots of test code commented out for now)