Bug fixes to sns plugin