Style tweaks, use indexOf instead of a regex to check for duplicate palette items.