Fixes to rt-rep.pl