Working on error generation.

Also added a class for testing error generation.