Includes a fix from J2K: 4e45a337da (cherry picked from commit b457cdb0c23fdaf0b0d2753dc0b22315e4ed6c20)
4e45a337da