Fixes #3. Maximized windows emits a reference to the restore function