Refine the any_instance passing implementation as per myron's suggestions.

Signed-off-by: Sam Phippen <samphippen@googlemail.com>