Fix stack overflow in issue #456