Fixed up new_document call