Fixed error reporting bug.