Last Command Sent Improvements

Hi guys,

I made some improvements to the way last command sent is set and put into an exception.  It wasn't being set at all for extended queries.

I thought maybe I should put this one up for review :)

-Glen