Merge pull request #40 from Magenic/master

Merge from Master
#162 fixed problem with code that adds extra permission records as part of the nightly service.
Merge pull request #165 from Bowman74/master

 #162 fixed problem with code that adds extra permission records