Fix client freeze + server infinite loop bug