fixed invalid tokenizing in "nested" locations

Plus additional places