Added OS detection