At first, I didn't consider the case when working with older documents that had heading above or below the highest or lowest allowable heading level, but I went back and fixed the plugin to work in these cases too.