Fix encodePNG.