Fix error handling bug and add last line defence against fatal errors.
Bump version