fixing bugs after initial cleanup