Fix code freezing issue on Linux.