Fix a bunch of minor issues.