apply some minor changes

Most of these changes were suggested by GM.