Simplified the error generation.
Some corrections in the error generation.