Fixed error with creating new windows on restart.