Deretić is right for origin of word vlach.
Vlachs = Slavic sheperds which celebtated Slavic god Veles. VELES = VLACHS.
Romanians are mix of vulgar Latin speaking imigrants from Epirus, Thessaly, Macedonia and Bulgaria which arrived to modern Romania from 12th to 14th century, and Slavs which lived in modern Romania since early middle age, plus minor Turkic influence (from Cumans, Pechenegs and Tatars).
Vlachs from eastern Serbia are originally Rumâni, they adopted Slavic name Vlachs from Serbs in the last 100-150 years.
Majority of Latin speaking population of Epirus, southern Albania, Theassaly and Macedonia always call themselves Rramâni and Armâni, and never Vlachs.
Megleno-Vlachs are only Latin speaking Balkanites which call themselves Vlachs, because they were under strong Slavic influence and they adopted Slavic word Vlachs for ethnic name. Megleno-Vlachs were always farmers, unlike other Latin speaking Balkanites which were semi-nomadic sheperds, that is also Slavic legacy among Megleno-Vlachs.
Vast majority of people which call themselves Vlachs in the middle age were genetically Slavic and Slavic speakers. Vlachs = Slavic sheperd caste (name originated from slavic god Veles).