Fixed a bug with error checks
Automated value checks, if  is not provided.