Small fixes for correctness.