Minor tightening up of code and comments