Added nicer support for `RELAY_END` handling.