Hello Peter,
Glad you got it working!
However, I'm not clear on why you should be manually marking anything as inactive. If you are using algorithm 4, you should not be getting any looping -- once you've burned through the set gateways returned by dispatcher, ds_next_dst() should fail and you should fall out of the failure_route, returning a 503 to the caller.
-- Alex