attempt to fix expandPatternsAndSimplify to ensure the result is fully simplified