fixed some mutable struct bugs