Moved error classes to error file and modified specs.