Fixes to smd