Fix wrong function signature.
Initialize default digest before other agent initialization.

Otherwise we can get into a situation where the wrong digest is
selected for the key hashes.
Merge pull request #983 from kacfengine/master

Some small fixes.