Fix the restart command sometimes deadlocking the server