Tidy up exception logging. Fixes #1201
Merge branch 'exp' into smallFixes
(keep small fixes in one branch)