properly handle elements in complex targets

Merged Piotr Gawron requested to merge 1579-drug-target-issue into devel_16.0.x

Merge request reports