Move deploy_usr definition to where it's used
Renamed variable & template fix