Fix a couple of bugs on Linux