Backported fix from EK goupx PART2