Better logging for job failure and cancellation.
Fixed a bug where the cancel() method was testing the old job state instead of the new job state.