Some code quality improvements.