Overhauled the palette system. Hopefully that's the end of those pesky palette bugs...