Make "make distclean" work again.
Merge pull request #722 from kacfengine/makeFix

Make "make distclean" work again.
Fix a typo
Fix ScopeDelete

Close #2781
Merge pull request #729 from sigurdteigen/master

Fix segfault resulting from bad ScopeDelete
Merge pull request #728 from tdlee/master

Fix a typo
Remove unneeded static function (only used once).
WIP