Fix compound document creation