Fixing update script bugs