Ensure that PathTemplate and PathElementTemplate implementations are
immutable after construction.