Bugfix for negative modulo result indexing the palette array