pass chain to get_target (fixes issue #316)