Some fine-tuning and cleaning up.