Robustness & correctness improvements.