Removed bugs from the bash script.