Fix color selection, and some other bugs