Add test for trailing slash and code to remove them if present.