Added removal of last slashes in a bunch of places since it seems to
make one of our libraries choke.