Bugfix on disjoint set check (XOR to OR), cast k in fcost method to double