Merging a fix for the focusing issue on restart