Fix bound checking for packed struct