merge: change the order of inputs reading
merge: macro before function specs parsing fix