fixed unary add and added a check for undefined variables