Fix error which could arise when gadget internal ordering did not agree with pynbody internal memory ordering