fixed generator for opaque structs