Begginning to change the error check structure

Begginning to change the error check structure to simplify the code and
make it easy to handle the new options.