change int -> bigint for foreign keys; add some verification when closestNodes are empty; and some minor fixes