Minor improvements and cleanup.