int/ptr cast warnings cleanup