Added explicit type conversions to remove warnings when using strict warning settings.