Fixed OS detection where it wasn't used