Fixed GetVariantInvocationCandidates. Fix for #354 and #426.

We have discussed it in #354 thread. I've worked with this fix huge time and no tests are failed by it, so maybe it is safe already to merge it in master branch.