Wmts fix

Suggested fix for issue #2274
You're reasoning makes sense, we can probably leave what you have there.  This won't actually cause an error, it will just make 'undefined' show up in the URL string, which is probably good for debugging problems.