Add trailing slash support (bug 868617)