Fixes a stack-overflow exception in expander's flatten that I was running up against.