fix some issues with lut generation