Renamed variable 'near' to 'near_ref' to fix issue #2204.