diff --git a/matrixpack.sh b/matrixpack.sh
index 48cdcda7160265b6b276319a2ed81f513b422093..03d1927b061059e7dd5bcf7f8c4ecedc6f4ddf49 100755
--- a/matrixpack.sh
+++ b/matrixpack.sh
@@ -18,13 +18,13 @@ if test $# != 3 ; then
 fi
 
 # Checking if ImageMagick is installed
-if ! command -v convert &> /dev/null; then
+if ! command -v magick &> /dev/null; then
     echo "$0:ERROR: magick could not be found"
     exit
 fi
 
 # Changing directory to work directly in it
-cd $3
+cd "$3"
 
 # Setting variables
 dir=$(pwd)