Improved OS version handling