Typecasting the for the future (to fix warnings)

XCode5 gives warnings about these implicit typecasts. Added explicit typecasting.