Fix compilation warning and alpha discarding.