Fix stack corruption error.