Fix a few memory leaks (DocumentDetailPage still leaks)