Closes issue #59, NullReferenceException with empty template and spurious parameters.