Fixed wrong return value and missing member copy.

Fixes issue 2965.
Merge pull request #756 from kacfengine/issue-2965

Fixed wrong return value and missing member copy.