Cleanups due to feedback. No functionality change. Patch by Alistair.