fix some crossplatform issues