diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp
index 0570480325b30ec09eb237ecae06d7d4a5e7bea4..2ee2b3d418f0d678373f253c12e9de5026dc49bd 100644
--- a/indra/newview/llimprocessing.cpp
+++ b/indra/newview/llimprocessing.cpp
@@ -70,7 +70,7 @@
 #include <boost/lexical_cast.hpp>
 #include <boost/tokenizer.hpp>
 
-std::string replace_wildcard(std::string input, const LLUUID& id, const std::string& name)
+std::string replace_wildcards(std::string input, const LLUUID& id, const std::string& name)
 {
 	boost::algorithm::replace_all(input, "#n", name);
 // disable boost::lexical_cast warning
@@ -171,11 +171,11 @@ void translate_if_needed(std::string& message)
     }
 }
 
-class LLPostponedIMSystemTipNotification : public LLPostponedNotification
+class LLPostponedIMSystemTipNotification final : public LLPostponedNotification
 {
 protected:
     /* virtual */
-    void modifyNotificationParams()
+    void modifyNotificationParams() override
     {
         LLSD payload = mParams.payload;
         payload["SESSION_NAME"] = mName;
@@ -183,11 +183,11 @@ protected:
     }
 };
 
-class LLPostponedOfferNotification : public LLPostponedNotification
+class LLPostponedOfferNotification final : public LLPostponedNotification
 {
 protected:
     /* virtual */
-    void modifyNotificationParams()
+    void modifyNotificationParams() override
     {
         LLSD substitutions = mParams.substitutions;
         substitutions["NAME"] = mName;
@@ -632,7 +632,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
 				std::string response = gSavedPerAccountSettings.getString(sAutorespondNonFriend && !is_friend
 					? "AlchemyAutoresponseNotFriend"
 					: "AlchemyAutoresponse");
-				response = replace_wildcard(response, from_id, name);
+				response = replace_wildcards(response, from_id, name);
 				pack_instant_message(
 					gMessageSystem,
 					gAgent.getID(),
@@ -754,7 +754,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
 					std::string response = gSavedPerAccountSettings.getString(sAutorespondNonFriend && !is_friend
 						? "AlchemyAutoresponseNotFriend"
 						: "AlchemyAutoresponse");
-					response = replace_wildcard(response, from_id, name);
+					response = replace_wildcards(response, from_id, name);
 					pack_instant_message(gMessageSystem,
 						gAgent.getID(),
 						FALSE,
diff --git a/indra/newview/llimprocessing.h b/indra/newview/llimprocessing.h
index 4d20b963a4af373af3812b91b99f72e6dd9ac3ca..e221e986819422de55869618098380c1b876454e 100644
--- a/indra/newview/llimprocessing.h
+++ b/indra/newview/llimprocessing.h
@@ -59,5 +59,8 @@ private:
     static void requestOfflineMessagesLegacy();
 };
 
+// Replace wild cards in message strings
+std::string replace_wildcards(std::string input, const LLUUID& id, const std::string& name);
+
 
 #endif  // LL_LLLLIMPROCESSING_H
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index b2f2624d4d764067795c2cb98c626a5ef15381f9..fa975940a71b0ad65316eaec29a88f01d9d6c01a 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -520,20 +520,6 @@ void process_layer_data(LLMessageSystem* mesgsys, void** user_data)
 	}
 }
 
-// Replace wild cards in message strings
-std::string replace_wildcards(std::string input, const LLUUID& id, const std::string& name)
-{
-	boost::algorithm::replace_all(input, "#n", name);
-
-	LLSLURL slurl;
-	LLAgentUI::buildSLURL(slurl);
-	boost::algorithm::replace_all(input, "#r", slurl.getSLURLString());
-
-	LLAvatarName av_name;
-	boost::algorithm::replace_all(input, "#d", LLAvatarNameCache::get(id, &av_name) ? av_name.getDisplayName() : name);
-	return input;
-}
-
 void process_derez_ack(LLMessageSystem*, void**)
 {
 	if (gViewerWindow) gViewerWindow->getWindow()->decBusyCount();
@@ -730,6 +716,9 @@ bool join_group_response(const LLSD& notification, const LLSD& response)
 			notification_adjusted = sSavedGroupInvite[id];
 			response_adjusted = sSavedResponse[id];
 		}
+		// Potential memory leak fix
+		sSavedGroupInvite.erase(id);
+		sSavedResponse.erase(id);
 	}
 
 	S32 option = LLNotificationsUtil::getSelectedOption(notification_adjusted, response_adjusted);
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index ff46487ecf88b9615c6c4a874f4f683f8c0e4a7d..946438a926dd839ccece2646eea2f14aa466cc96 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -3047,7 +3047,6 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
 	capabilityNames.append(CAP_NAME_OBJECT_MEDIA);
 	capabilityNames.append("ObjectMediaNavigate");
 	capabilityNames.append("ObjectNavMeshProperties");
-	capabilityNames.append("OpenSimExtras");
 	capabilityNames.append("ParcelPropertiesUpdate");
 	capabilityNames.append("ParcelVoiceInfoRequest");
 	capabilityNames.append("ProductInfoRequest");
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index ffd2c4cb092a4122795d348f3fc7ebbd0fc19083..868e8b2096a92c4d7a7277d9863cab97a8f08c40 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -7563,6 +7563,10 @@ Offer a teleport?
        index="1"
        name="Decline"
        text="Decline"/>
+      <button
+       index="2"
+       name="IM"
+       text="IM"/>
     </form>
   </notification>
 
@@ -7594,6 +7598,10 @@ Offer a teleport?
        index="1"
        name="Decline"
        text="Decline"/>
+      <button
+       index="2"
+       name="IM"
+       text="IM"/>
     </form>
   </notification>