Herald security fixed rebase

fixed rebase problem of last rebase attempt.

- reverted last commit
- re-applied with correct rebase conflict resolutions (hopefully)