FIXED: adapting to updated SWI-cpp.h