FIX: Cast to int before creating cert