Update functions.php

Fix: expand %var% variables