Fixes to format SMS function