Fix up code quality issues