Changed error reporting.
Merged.