improved "os" detection code.