More tests and the fixes they provoked.
Added a few comments.
More comments.