Made it handle slashes better.

If there is something without a slash at the end, this takes care of it.