Fix counting
Integer casting for id