Fixes to make connections more reliable.