Fixing a bug in errors.

Also removed unneeded commented out code.