Fix tests to work in gadget mode as well.