Improved color handling, some cleanup.