Bug fix for fb_template_match and small changes to roi analysis