Fix nested structs being expanded in headers

Fixes #889