Bugfixes packages validation

Bug fixed in file src/generic_agent.c 

Redmine issue: 1931 solved.