Made a few tweaks to deal with SMS version compatibility