Many minor code changes

I hope this doesn't break anything
Correct and comment recently changed functionality

Sometimes I change or remove things to see if they are needed. Here, I
eventually found that this was needed. (I left it commented out in the
source code because I didn't know.)