fixed a bug that was affecting the flag-setting and histogram-filling of pairs of type 'object - secondary object'