Improve OS detection