Some error reporting fixes.