Add template
change tunnel param names
minor debugging fixes