Fixed parsing of expressions and functions