Use a small offset to turn NEAREST into floor() when sampling the clut.

Minor fixes and cleanups.