CONN-625: fixes for bugs found while testing.