Various code clean-ups.