History bug regarding #2989 and #2963

You could probably get rid of len and use _locations.length