More improvements to app_rpt.c