diff --git a/workflow/scripts/plot_profile.sh b/workflow/scripts/plot_profile.sh
index b31596a1d623e01cf3e003106a1972a420224e3a..277f99335e35595876ea74f4bdfa1dfa04c558e6 100755
--- a/workflow/scripts/plot_profile.sh
+++ b/workflow/scripts/plot_profile.sh
@@ -18,15 +18,15 @@ raise()
 }
 
 check_tools() {
-	raise "
+  raise "
    Checking for required libraries and components on this system
    "
-	 deeptools --version &> version_deeptools.txt
-	 if [ $? -gt 0 ]
-	 	then
-			raise "Missing deeptools"
-			return 1
-		fi
+   deeptools --version &> version_deeptools.txt
+   if [ $? -gt 0 ]
+     then
+      raise "Missing deeptools"
+      return 1
+    fi
 }
 
 compute_matrix() {
@@ -34,13 +34,13 @@ compute_matrix() {
   Computing matrix on ${1} using ${2}
   "
 
-	computeMatrix reference-point \
-		--referencePoint TSS \
-		-S ${1} \
-		-R ${2} \
-		--skipZeros \
-		-o computeMatrix.gz \
-		-p max/2
+  computeMatrix reference-point \
+    --referencePoint TSS \
+    -S ${1} \
+    -R ${2} \
+    --skipZeros \
+    -o computeMatrix.gz \
+    -p max/2
 
   if [ $? -gt 0 ]
   then
@@ -54,8 +54,8 @@ plot_profile() {
   Plotting profile
   "
 
-	plotProfile -m computeMatrix.gz \
-		-out plotProfile.png
+  plotProfile -m computeMatrix.gz \
+    -out plotProfile.png
 
   if [ $? -gt 0 ]
   then
@@ -69,7 +69,7 @@ run_main() {
 
   # Parsing options
   OPTIND=1 # Reset OPTIND
-  while getopts :gh opt
+  while getopts :g:h opt
       do
           case $opt in
               g) gtf=$OPTARG;;
@@ -84,20 +84,20 @@ run_main() {
       usage
   fi
 
-	bws=$(ls *.bw)
+  bws=$(ls *.bw)
 
   check_tools || exit 1
 
-	compute_matrix "${bws}" "${gtf}" || return 1
+  compute_matrix "${bws}" "${gtf}" || return 1
 
-	plot_profile || return 1
+  plot_profile || return 1
 
   raise "ALL COMPLETE"
 }
 
 if [[ "${BASH_SOURCE[0]}" == "${0}" ]]
 then
-  run_main
+  run_main "$@"
   if [ $? -gt 0 ]
   then
     exit 1