added explicit type conversions to fix implicit conversion warnings