Tweaks to connection logic
Starting cleanup so tests pass
Fixed tests