some fixes to struct handing