Enhancements to stop script

Changed the criteria for the where clause to InstanceStatus rather than
PowerState