Fixed Nb, changed interface a bit, adding more tests.