little bugfixes on closing windows and constraint mode.