What's the difference among object, active_object, and selected_objects?
I am fairly sure the first is true, but the second isn't.

The list of selected_objects is expanded as new objects are added, new selections are added to the end of the list, while manually selecting the last addition will be the active object, so active_object is rarely the first in the selected_objects list.

There are some conditions that may catch you out. 


When deselecting all objects, the last active object remains active even though it may no longer be selected.
When setting items as selected with python the active object does not automatically change.
Select all does not alter the active object.
Deleting the active object leaves you with no active object.