Fix signal handling