added test cases for issue 412
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/issue186/issue186.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/issue186/issue186.1.ddl.aql
deleted file mode 100644
index e69de29..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/issue186/issue186.1.ddl.aql
+++ /dev/null
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/issue186/issue186.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/issue186/issue186.2.update.aql
deleted file mode 100644
index e69de29..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/issue186/issue186.2.update.aql
+++ /dev/null
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/issue186/issue186.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/issue186/issue186.3.query.aql
deleted file mode 100644
index 0ff1d3c..0000000
--- a/asterix-app/src/test/resources/runtimets/queries/aggregate/issue186/issue186.3.query.aql
+++ /dev/null
@@ -1,3 +0,0 @@
-for $x in [1, 2]
-let $y := (for $i in [[1,2,3],[10,20,30],[-2,-5,0]] return min($i))
-return min($y)
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/issue412/issue412.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/issue412_0/issue412_0.1.ddl.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/aggregate/issue412/issue412.1.ddl.aql
rename to asterix-app/src/test/resources/runtimets/queries/aggregate/issue412_0/issue412_0.1.ddl.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/issue412/issue412.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/issue412_0/issue412_0.2.update.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/aggregate/issue412/issue412.2.update.aql
rename to asterix-app/src/test/resources/runtimets/queries/aggregate/issue412_0/issue412_0.2.update.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/issue412/issue412.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/issue412_0/issue412_0.3.query.aql
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/queries/aggregate/issue412/issue412.3.query.aql
rename to asterix-app/src/test/resources/runtimets/queries/aggregate/issue412_0/issue412_0.3.query.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/issue412/issue412.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/issue412_1/issue412_1.1.ddl.aql
similarity index 100%
copy from asterix-app/src/test/resources/runtimets/queries/aggregate/issue412/issue412.1.ddl.aql
copy to asterix-app/src/test/resources/runtimets/queries/aggregate/issue412_1/issue412_1.1.ddl.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/issue412/issue412.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/issue412_1/issue412_1.2.update.aql
similarity index 100%
copy from asterix-app/src/test/resources/runtimets/queries/aggregate/issue412/issue412.2.update.aql
copy to asterix-app/src/test/resources/runtimets/queries/aggregate/issue412_1/issue412_1.2.update.aql
diff --git a/asterix-app/src/test/resources/runtimets/queries/aggregate/issue412_1/issue412_1.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/aggregate/issue412_1/issue412_1.3.query.aql
new file mode 100644
index 0000000..f9bc64e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/aggregate/issue412_1/issue412_1.3.query.aql
@@ -0,0 +1,2 @@
+let $l := [1, 60, null]
+return { "count": count($l), "average": avg($l), "sum": sum($l), "min": min($l), "max": max($l) } 
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/issue186/issue186.1.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/issue186/issue186.1.adm
deleted file mode 100644
index 978069e..0000000
--- a/asterix-app/src/test/resources/runtimets/results/aggregate/issue186/issue186.1.adm
+++ /dev/null
@@ -1,2 +0,0 @@
--5
--5
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/issue412/issue412.1.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/issue412_0/issue412_0.1.adm
similarity index 100%
rename from asterix-app/src/test/resources/runtimets/results/aggregate/issue412/issue412.1.adm
rename to asterix-app/src/test/resources/runtimets/results/aggregate/issue412_0/issue412_0.1.adm
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/issue412_1/issue412_1.1.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/issue412_1/issue412_1.1.adm
new file mode 100644
index 0000000..7c1107a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/issue412_1/issue412_1.1.adm
@@ -0,0 +1 @@
+{ "count": 3, "average": null, "sum": null, "min": null, "max": null }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_count_null/scalar_count_null.1.adm b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_count_null/scalar_count_null.1.adm
index 1abbc3f..4ff1111 100644
--- a/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_count_null/scalar_count_null.1.adm
+++ b/asterix-app/src/test/resources/runtimets/results/aggregate/scalar_count_null/scalar_count_null.1.adm
@@ -1,7 +1,7 @@
-null
-null
-null
-null
-null
-null
-null
\ No newline at end of file
+4
+4
+4
+4
+4
+4
+4
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 5849110..c79efac 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -1,18 +1,18 @@
 <test-suite xmlns="urn:xml.testframework.asterix.ics.uci.edu" ResultOffsetPath="results" QueryOffsetPath="queries" QueryFileExtension=".aql">
   <test-group name="aggregate">
     <test-case FilePath="aggregate">
-      <compilation-unit name="issue186">
-        <output-dir compare="Text">issue186</output-dir>
-      </compilation-unit>
-    </test-case>
-    <test-case FilePath="aggregate">
       <compilation-unit name="issue395">
         <output-dir compare="Text">issue395</output-dir>
       </compilation-unit>
     </test-case>
     <test-case FilePath="aggregate">
-      <compilation-unit name="issue412">
-        <output-dir compare="Text">issue412</output-dir>
+      <compilation-unit name="issue412_0">
+        <output-dir compare="Text">issue412_0</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="aggregate">
+      <compilation-unit name="issue412_1">
+        <output-dir compare="Text">issue412_1</output-dir>
       </compilation-unit>
     </test-case>
     <test-case FilePath="aggregate">