Fix locality bug