minor changes + callback optional when stopping the discoverer, and fixed unit tests