Fix palette errors.
Improve performance of 2D histogram graphs.