More code quality fixes