correctness fixes