Castle makes a crack about the name "Stanley" not being a unisex name. In fact, President Barack Obama's mother was named Stanley, after the Bette Davis character in the movie In This Our Life (who was also female).
At the crime scene at the episode's start, the Cecil Hotel is clearly shown in the shot behind Castle. The Cecil Hotel is one of LA's most notorious landmarks (having housed Richard Ramirez-"The Night Stalker"- during the time he was active) and actually the basis for "American Horror Story Hotel". Castle takes place in NYC not LA.
When the old lady Wellesley explains to Beckett how she found out that Olivia was related, she says that she couldn't allow Blake (Mark Moses) to be the father. "He was too special, he could be president." In The Last Ship (2014), Marks Moses plays the president of the United States (Season 2).