Fixed stack-is-full check so that it doesn't allocate a new larger array early.