kernel: Use NELEM() in a number of places.