Fix error when last_exception is nil