diff --git a/gridss.wdl b/gridss.wdl
index 069d6953d876f3dbced771cc0f1ef1e573ce88c7..aedac9aba54d42bbdfb0180933f437614a2f67d7 100644
--- a/gridss.wdl
+++ b/gridss.wdl
@@ -39,7 +39,9 @@ task AnnotateInsertedSequence {
     }
 
     command {
-        AnnotateInsertedSequence -Xmx~{javaXmx} \
+        set -e
+        _JAVA_OPTIONS="${_JAVA_OPTIONS}:-Xmx~{javaXmx}"
+        AnnotateInsertedSequence \
         REFERENCE_SEQUENCE=~{viralReference} \
         INPUT=~{inputVcf} \
         OUTPUT=~{outputPath} \
@@ -215,6 +217,7 @@ task Virusbreakend {
     }
 
     command {
+        set -e
         mkdir virusbreakenddb
         tar -xzvf ~{virusbreakendDB} -C virusbreakenddb --strip-components 1
         virusbreakend \