Some tidying, better connection error reporting, progress info every hundred messages. (Thanks to B-LUC Consulting)