$set in mongo sometimes has a out of bounds in "where" if "where" is a list. Put in extra protection against out of bounds access.