Merge "Set alpha channel correctly when recomputing gradient" into klp-dev