Fix bugs in Linux