OPNF fix

This fixes an OPNF bug exposed by speedChess and a possible performance issue discovered while tracking down the bug.