Issue #1412614: Fix to the token_replace function by aasarava so the clear attribute is set correctly.