Tightened up code and style in a few places