Fix a bunch of reported issues.