Minor improvements. No change to algorithms.