Fixing up a few bugs introduced in last refactor.

It seems the term "prefix" gets a little convoluted in the code, we might want to try and clean it up a bit.  I did a little work on it in this change set (i.e. it sometimes isn't clear if 'prefix' refers to a URL prefix or a path prefix).