 
   # Public: Returns true if the specified path exists and is a file.
   isFileSync: (filePath) ->
-    return false unless filePath?.length > 0
+    return false unless isPathValid(filePath)
     if stat = statSyncNoException(filePath)
       stat.isFile()
     else


  # Public: Asynchronously checks that the given path exists and is a directory.
  isDirectory: (directoryPath, done) ->
    return done(false) unless directoryPath?.length > 0
    fs.exists directoryPath, (exists) ->
      if exists
        fs.stat directoryPath, (error, stat) ->


  # Public: Returns true if the specified path is executable.
  isExecutableSync: (pathToCheck) ->
    return false unless isPathValid(pathToCheck)
    if stat = statSyncNoException(pathToCheck)
      (stat.mode & 0o777 & 1) isnt 0
    else
