Minor improvements to code.