Added color palette support, various enhancements