Applied a patch from pangel to fix make_gadget_pspec.