agv: fix logfile selection and encoding problem