Fix issue where check for final slash was comparing zero-based index with length