 
       applicationLayoutFile = grunt.file.read layoutFilePath, "utf8"
 
-      for filePathPart in grunt.file.expand(path.join(viewDir, "**", "*")) when fs.lstatSync(filePathPart).isFile()
+      for filePathPart in grunt.file.expand(path.join(viewDir, "**", "*")) when fs.statSync(filePathPart).isFile()
 
         filePath = path.resolve filePathPart
 

  copyFilesSyncRecursive = (options)->
    grunt.verbose.writeln "Copying files from #{options.sourcePath} to #{options.destinationDir} using #{options.relativeDir} as basedir"

    for filePath in grunt.file.expand options.sourcePath when fs.lstatSync(filePath).isFile()
      grunt.verbose.writeln "Copying file #{filePath}"

      relativePath = path.relative options.relativeDir, filePath

    viewDirectories = []

    # get each view folder (except layout)
    for dirPath in grunt.file.expand(path.join(appViewsDirectory, "*")) when fs.statSync(dirPath).isDirectory()
      basePath = path.basename(dirPath)
      unless basePath is "layouts" + path.sep or basePath is "layouts"
        viewDirectories.push dirPath
