Fixed s casting issue and an object creation issue with ipad and opad.