Don't assign DS to window unless window exists - Fixes #681