Hack around weird document handling.

Signed-off-by: Horváth Balázs <q@qroa.ch>