Fix in getLength function

Fixed a bug affecting getLength / getKeys / clearAll functions