Minor tweaks to error logging