Ensure that a valid document line index is used.

If no CodeDom header is present then a value of 0 will be used which is
invalid.
Merge pull request #645 from 7sharp9/fixdocumentindex

Ensure that a valid document line index is used.