Fix template assertion when opening a session.