Many small bugs and comment improvements that should have been in the
initial commit.