Fix hg controller

Fix syntax error in the hosts controller extensions
Escape the string interpolation so that it doesn't happen until usage.