Secondary weight out of bounds was picked up in mistake when the string is empty, instead of returning 0.