Adding error checking 

Error checks in both parsing and evaluating of parsed functions.