Fixed error reporting problems.