Make the program write_connect more portable.
Merge branch '1.8' into 1.9.