Fix document management