fix bytes order on mac os x