Fix 180 degree rotation of devices