some crossplatform fixes