     viewDirectories = []
 
     # get each view folder (except layout)
-    for dirPath in grunt.file.expand(path.join(appViewsDirectory, "*")) when fs.lstatSync(dirPath).isDirectory()
+    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


      applicationLayoutFile = grunt.file.read layoutFilePath, "utf8"

      for filePathPart in grunt.file.expand(path.join(viewDir, "**", "*")) when fs.lstatSync(filePathPart).isFile()

        filePath = path.resolve filePathPart


    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
