relay: some fixes for mode changes and fix NPE on pongs