Ported Alex's OPNF fix