Cast the element type to int in stacks