Hi, thanks for pointing me to the issues you opened. I have updated https://issues.qgis.org/issues/18153 with a minimal example (raster + qml) that could help to understand the problem. Cheers Matteo