Fixed some bugs with the struct type