Fixed the pulling in of sub templates