Bug fix when scanning for nearby devices.