improved handling of escaping variables
simplified UnaryExpr code
fixed UnaryExpr (fixes #48)