Fix a few issues prevent linux build.