Fixed some problems with mutability