Improvments to va/fun auto detect