fixing nullpointerexception; function execution should reside to defining class members here functions and errorreturn
add tests for stdlibfunctionreturn