Fix a few code quality issues