fix minor bugs in SM
Merge branch 'pr/193'