Fix diagram formatting