Fixed possible problems with update script