Minor improvements for correctness