Fixed type validation for ret instruction