Library code multiplatform improvements