fixed trailing dir slash when using slug

See testcase, dir + slug contained double slash when dir had a trailing
slash.