Moved set -e down and fixed argument count check