Working a case involving heroin smuggling and a gang war, Beckett runs across a victim killed in the same manner as her mother. Finally catching up with her mother's killer, there is a tense showdown at the police station, after which Castle says he's through tagging along with Beckett, and Beckett says she's gotten used to having him around, that he makes her job more fun.
What a great way to end the series.
Except it's not the end. There are nine more episodes this season. But this was the thirteenth episode of the season, and I think the writers were hedging their bets against the show being canceled at this point a la Dollhouse.