dis31: fix bugs caused by the port to Linux