Proposed fix for the activedocument management.
Merge pull request #2 from Mattias1/gfate-intergration

Proposed fix for the activedocument management.