Expose debug flag on document