Fix cast to pointer from integer of different size