bug fixes and adapation of the security cmdlets