Misc. code quality improvement