Handle slash without anything before it

This avoids an NPE on input of "/".

Feels like a sure thing, but I'd be grateful to have a sanity check from someone else before I do a release.