A few robustness and debugging changes