Fix disposing of Document.Controller.