fixes some of #6017590 -- issue causing exceptions

Trying to evaluate an expression that is only partially formed
(for example, it does not have any elements in a sub expression)
now throws a MalformedExpressionError