connection improvements and other minor fixes