Fixing installation script

The use of !$ variable doesn't work. Also each command runs only if the previous one was successful.