Fixes #136 SMF 2 attachments are calculated wrong

Also fixed issues with duplicated attachment names and duplicated code in smf1
Merge remote-tracking branch 'origin/feature' into feature