Fixed a bug returning incorrect values for variableExists
Changed the struct Callback to c++11 lambdas