Fix addNearest with data.table input