Replace safe_basename/safe_dirname w/ SafeBasename/SafeDirname.

So errors can be better handled.