An incorrect way of checking for error status was fixed.