Fixed the resolved so that the timeout code is triggered correctly.
Tidied up the exception handling code.
Add corrupt message log, which dumps data to a log file for later inspection.
Bump version.