Merge pull request #1387 from jlipps/master

fix tracetemplate detection logic and logging (fix #1386)
fix appium device end callback logic (fix #1389)