Fixed #7155: Improve location filter