Fix #1621 : User query per last applied template triggers an error