Fixed a problem with SLIST_ENTRY.
Fixed looped gateway tests.