Moved handleMapEvents() to occur before calculateBehavior().

calculateBehavior() was executing on an older version of the map.