Fix logic determining when to shut down an instance past its runtime
Now limit to only instances that are in the "running" state