Fix type error when length applies to array not object

Mistake in previous commit, where the length of the object should be Object.keys(...).length, the reporting were all broken :x