Tidy up of error handling.  Exclude temporary files.
Allow for more than one master / slave combination