Fix relay and add debugging