Fixed type conversions to fix linux build