Moved palette setting into method to avoid undefined rgb_t instances;
included log control flags. (nw)