Better logging
Some belts and braces
Work around a slight regression introduced by the file upload via webservices fix.