Fixed minor data structure bugs.