Fixing type conversion warnings