Fixed a bug related to simplifyExpression