Fixes to streaming code
Cleanup template stuff
Merge remote-tracking branch 'origin/master'