 
       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

    javascripts = []
    sourceFiles = grunt.file.expand Paths.application.compiles.models

    for filePath in sourceFiles when fs.statSync(filePath).isFile()
      grunt.verbose.writeln "Compiling model file at #{filePath}"
      javascripts.push grunt.file.read(filePath, "utf8").toString()
      fs.unlinkSync filePath
