Fix a variety of minor issues