Fixed custom nearest neighbor to properly replace bad neighbors with fill value.