Fixes for SMS Middleware

Change-Id: Ic948e0d810ef6bb4bded40a9733b744fce58c5bc