Fix exceptions when processing incoming events over federation