relay: reformat code and fix build