Dvolgyes fixes

Hi,

I made some suggested modification, rebased the branch, and now I try a pull request.
Please, review it again. (Actually, there are other changes not just the incorporated suggestions, but not too many.)

Original PR: https://github.com/cfengine/core/pull/1112