Change index ordering in rtvd related routines. Thanks go to Mariusz Mamoński for pointing that out