Fixed cminstaller.sh

It didn't run first because there was syntax errors, but I fixed all of them and also one bug.