Fix signal panic (#2787)