Fixed problems with memory allocation in rdveg