Fix infinite loop

If os.path.split is called with a path beginning from with a slash,
it will eventually return ('/', '') which will be looped back as '/'
which creates an infinite loop. Check for this condition. This is not
a nice fix and may cause another problem. Ref #53