Issue #3225888 by socketwench, pfrilling, gwvoigt: RouteEnhancer::enhance() needs more type checking on passed term