Fix for nearest point queries on poly shapes