Regression tests for extension template dependencies and assorted fixes.