good movie spoiled by unexplained/confusing events

Rating: 7/10 (29 July 2012)

It was intriguing to see the gang and the cops predicting each other's moves, except this play of deception suddenly stopped making sense towards the end of the film.
It shouldn't have been too hard for the cops to work out that when Capt. Queenan was killed, the mole was either Colin or one of the officers following Queenan that day, yet nobody mentions this. When Colin orders the followers not to pursue the van, it makes it even more evident that he's the mole.
During the meeting with the Chinese, how do the FBI tapping everyone's phones not spring Colin?
Before Frank's downfall, why does Billy try to convince Frank that he's about to be sprung?
Once the psychiatrist discovers that Colin is a spy for Frank, why is she left alive?
Instead of running away and master-minding a failed plot, why didn't Billy run straight to a high-ranking cop and reveal Colin as soon as he noticed the envelope?
How did the FBI mole know about Colin and why would he protect him?
How did Dignam find out about Colin? The police wouldn't have told him or they would've arrested him themselves. Madolyn could have only told him if Billy had given her Dignam's contact information, but he was never around the police computers to check and any contact information relevant to Dignam's former position would have likely become invalid as soon as he quit (I assume he wouldn't have used his personal number to contact Billy)? Besides, if he had Dignam's contact information, why was there any need to leave the evidence with Madolyn?
If Billy knew Dignam's contact information, he would never have had to arrange the risky meeting with Colin, as he could've relied on Dignam to back him up in the case that Colin had erased Billy's file. Why did that come as a surprise to Billy anyway? Shouldn't it have been obvious? Considering that Billy wasn't aware of his file being erased, what was the point of running away then later arranging the meeting anyway? His only request in the extortion of Colin was to get his identity back, which he could've got easily if he just stuck around at the police station instead of running away. The fact that he could arrest Colin at the meeting left him in the same situation as if he had stayed in the police station, as he would still need to explain the story to the rest of the police.
Why does nobody spot Colin during the presumed investigation of the Chinese cook's murder/assault? Even if they didn't know that Colin was a detective, surely they should've spotted Colin in the footage then done a search for him?
Forensics experts might've seen problems with Colin's explanation for Billy's murder and why any of them were there in the first place, but that's not a big deal compared to the other problems in the movie.