some correctness improvements