Fix stack overflow/underflow error messages