Added missing test
Fixed setting scope when merging messages