Like season five's finale, this was written as a possible swan song for Jessica, due to the uncertainty surrounding Angela Lansbury returning for another season. Because of this, two endings were filmed. One of these had Jessica wink at the camera (which could either be used or not depending on the outcome of negotiations with Lansbury). This was ultimately used and Lansbury did return for more series.
In the very final scene, the fourth wall is broken by the three on screen characters winking directly into the camera.
Harry McGraw (Jerry Orbach) says to Jessica " Who do you think I am, Sam Spade?" Sam Spade is a fictional character and the protagonist of Dashiell Hammett's 1930 novel, The Maltese Falcon.