More palette index checks to avoid getting into a derpy state.