Bug #1886: All dialogs now open with focus on first input
(cherry picked from commit a6bddd216319224a09561dcfcbb8dae866e9805b)
Bug #1962: Extended template table now is more careful with context

Removed commented code
(cherry picked from commit 7b56ae830176ce8e7ecd1a0391860986d109605f)