Get rid of hard-coded track lengths

Additional usage of the ARRAY_SIZE macro, plus a fix of the include guard.