Sync with latest changes from official repo

Security issues fixed