Miscelaneous fixes.
Code review changes.