Add [<Struct>] attribute if necessary

Fixes #833.