Fix focus/close errors