Modified rawstruct api and added couple unit tests