fix bugs so that it can be used on Linux