Fix some error reporting