diff --git a/eck.classes.inc b/eck.classes.inc
index a1171ef..321491b 100644
--- a/eck.classes.inc
+++ b/eck.classes.inc
@@ -5,30 +5,30 @@
   public $is_new;
   //Iterator variable
   private $position;
-
+
   //The database table where the objects exist
   private $table;
   private $vars;
   private $data;
-
+
   private $primary_keys;
   private $serialize;
-
+
   protected function __construct($table){
     $this->serialize = array();
     $this->is_new = TRUE;
     //Iterator variable
     $this->position = 0;
-
+
     $data = array();
     //is this a real table, check it
-
-
+
+
     if($schema = drupal_get_schema($table)){
       $this->table = $table;
       $this->primary_keys = $schema["primary key"];
       $this->vars = array_keys($schema['fields']);
-
+
       //do we want to handle searialized variables by default? let's do it
       //and wait for some critizism
       foreach($schema['fields'] as $name => $field){
@@ -45,21 +45,21 @@
       //@todo throw an exception
     }
   }
-
+
   function __set($var, $value){
     if(in_array($var, $this->vars)){
       $this->data[$var] = $value;
     }
   }
-
+
   function __get($var){
     if(property_exists($this, $var)){
       return $this->{$var};
     }
-
+
     return $this->data[$var];
   }
-
+
   public function __isset($name) {
     return isset($this->data[$name]);
   }
@@ -68,18 +68,18 @@
   public function __unset($name) {
     unset($this->data[$name]);
   }
-
+
   //DB Interaction Functions
   public function save(){
-
+
     //before we save, lets serialize the properties that require it
     foreach($this->serialize as $property){
-
+
       $this->{$property} = drupal_json_encode($this->{$property});
     }
-
-
-
+
+
+
     if($this->is_new){
       $this->id =
       db_insert($this->table)
@@ -93,24 +93,24 @@
       ->fields($this->data)
       ->execute();
     }
-
+
     //now that we are done saving lets deserialize in case that for some
     //reason we will continue manipulating the properties
     foreach($this->serialize as $property){
       $this->{$property} = drupal_json_decode($this->{$property});
     }
-
+
     $this->is_new = FALSE;
   }
-
+
   protected function load($property, $value){
-    $result =
+    $result =
     db_select($this->table, 't')
     ->fields('t')
     ->condition($property, $value,'=')
     ->execute()
     ->fetchAssoc();
-
+
     if($result){
       foreach($result as $property => $value){
         if(in_array($property, $this->serialize)){
@@ -121,9 +121,9 @@
       //we should only set the is_new flag as false if we loaded something
       $this->is_new = FALSE;
     }
-
+
   }
-
+
   public function delete(){
     //we can only deleted if its a loaded object, or if it has been saved
     if(!$this->is_new){
@@ -135,9 +135,9 @@
       //for right now lets just set it back to new
       $this->is_new = TRUE;
     }
-
+
   }
-
+
   //Iterator Interface Functions
   function rewind() {
       $this->position = 0;
@@ -165,31 +165,31 @@
 }

 class EntityType extends DBObject{
-
+
   //If an entity type is new, we can create its table from the current data of
   //the object, but if this is a loaded object, we need to actually keep
   //track of the changes happening so we can modify the already existing table
   //appropiately.
   private $changes;
-
+
   public function __construct(){
     parent::__construct('eck_entity_type');
     $this->properties = array();
     $this->changes = array();
   }
-
+
   public function addProperty($name, $label, $type, $behavior = NULL){
     if(!$this->is_new){
       $this->recordFieldChange('add', $name);
     }
-
+
     $p = $this->properties;
     //@todo check that type is an actual type
     $p[$name] = array('label' => $label, 'type' => $type, 'behavior' => $behavior);
-
+
     $this->properties = $p;
   }
-
+
   public function removeProperty($name){
     $p = $this->properties;
     if(array_key_exists($name, $p)){
@@ -200,7 +200,7 @@
       }
     }
   }
-
+
   public function changeBehavior($name, $behavior){
     $p = $this->properties;
     //@todo check that type is an actual type
@@ -212,14 +212,14 @@
     }else{
       //@Todo add exception.. the property does not exist
     }
-
+
     $this->properties = $p;
   }
-
+
   public function removeBehavior($name){
     $this->changeBehavior($name, NULL);
   }
-
+
   private function recordFieldChange($op, $name){
     //If it is not new we need to keep track of stuff
     if(!$this->is_new){
@@ -232,16 +232,16 @@
             $c[$op][] = $name;
           }
         break;
-
+
         case 'remove':
           //if there is an add in the changes take it out, otherwise add a
           //remove
           if(array_key_exists('add', $c)){
-
+
             $key = array_search($name, $c['add']);
             if($key != FALSE){
               unset($c['add'][$key]);
-            }
+            }
           }else{
             $c[$op][] = $name;
           }
@@ -250,7 +250,7 @@
       $this->changes = $c;
     }
   }
-
+
   public function save(){
     if($this->is_new){
       module_load_include('inc', 'eck', 'eck.entity_type');
@@ -264,7 +264,7 @@
       //modify the already existing table in accordance with the recorded changes
       if(array_key_exists('add', $this->changes)){
         foreach($this->changes['add'] as $name){
-          //first lets get the record
+          //first lets get the record
           $properties = $this->properties;
           $property = $properties[$name];
           //now we check to see whether it is a default or a custom property
@@ -282,11 +282,11 @@
       // Allow other modules to respond to the change of entity types.
       module_invoke_all('eck_entity_type_update', $this);
     }
-
+
     parent::save();
     drupal_get_schema(NULL, TRUE);
   }
-
+
   public function delete(){
     parent::delete();
     db_drop_table('eck_'.$this->name);
@@ -296,11 +296,11 @@

     drupal_flush_all_caches();
   }
-
+
   public static function loadByName($name){
     return EntityType::loadAll($name);
   }
-
+
   public static function loadAll($entity_type_name = '', $reset = FALSE){
     static $entity_types;

@@ -331,22 +331,22 @@
     }

     if (!$entity_type_name) return $entity_types;
-
+
     if (isset($entity_types[$entity_type_name])) return $entity_types[$entity_type_name];
   }
 }

 class Bundle extends DBObject{
-
+
   public function __construct(){
     parent::__construct('eck_bundle');
     $this->config = array();
   }
-
+
   private function createMachineName(){
     $this->machine_name = "{$this->entity_type}_{$this->name}";
   }
-
+
   private function createLabel(){
     $name = $this->name;
     $pieces = explode("_", $name);
@@ -354,48 +354,48 @@
     foreach($pieces as $piece){
       $final[] = ucfirst($piece);
     }
-
+
     $this->label = implode(" ", $final);
   }
-
+
   public function save(){
     //Lets do some checks before the bundle is saved
     if(isset($this->entity_type) && isset($this->name)){
-
+
       $save = TRUE;
       //we are good
       //@todo we should check that the entity type is a proper
       //entity type object
-
+
       //Lets set the machine name
       $this->createMachineName();
-
+
       //if this bundle is_new we need to check that it does not exist
       //@todo we just need to change the field in the db to be unique
       if($this->is_new){
         $bundle = Bundle::loadByMachineName($this->machine_name);
-        if(!$bundle->is_new){
+        if(!empty($bundle) && !$bundle->is_new){
           $save = FALSE;
         }
       }
-
+
       if(!isset($this->label)){
         $this->createLabel();
       }
-
+
       if($save){
         parent::save();
       }else{
         //@todo throw some error
       }
-
+
     }else{
       //if the name an entity type are not set, we can not save
       //the bundle
       //@todo throw soem error or exception
     }
   }
-
+
   /**
    * This method returns a bundle object
    * @param $machine_name
@@ -405,7 +405,7 @@
   public static function loadByMachineName($machine_name){
     return Bundle::loadAll($machine_name);
   }
-
+
   public static function loadAll($machine_name = NULL, $reset = FALSE){
     static $bundles;

@@ -453,7 +453,7 @@
         $bundles,
         function ($bundle) use ($entity_type_name) {
           return $entity_type_name == $bundle->entity_type;
-        }
+        }
       );
     }

@@ -466,7 +466,7 @@
   *
   * @param $field_type
   *   The type of field to add. One of the keys as defined by any field module using hook_field_info.
-  *
+  *
   * @param $options
   *   This is an optional array. Its properties can include:
   *   - use existing: If TRUE and if a 'field_name' property is specified in the 'field'
@@ -482,7 +482,7 @@
   *   - instance: all options accepted by field_create_instance(). Defaults will be used for
   *     each property that is omitted. 'bundle' and 'entity_type' properties are ignored because
   *     they come from the bundle info. The field_name property is either generated or taken from
-  *     the field properties.
+  *     the field properties.
   *
   * @return
   *   The $instance array with the id property filled in as returned by field_create_instance().
@@ -535,32 +535,32 @@
 }

 class ECKEntity extends Entity{
-
+
   //this flag only gets set so we can make our properties public again
   //before we save the object;
   private $ignore_validation;
-
+
   private $property_values = array();
-
+
   public function __construct(array $values = array(), $entityType = NULL){
-
+
     $this->ignore_validation = FALSE;
-
+
     parent::__construct($values, $entityType);
-
+
     //I have this stupid crap.. fixing drupals mess ups.
     $entity_type_name = $this->entityType();
     $entity_type = EntityType::loadByName($entity_type_name);
     $properties = $entity_type->properties;
     $property_names = array_keys($properties);
-
+
     foreach($property_names as $pn){
       $value = $this->{$pn};
       unset($this->$pn);
       $this->{$pn} = $value;
     }
   }
-
+
   public function __set($name, $value) {
     //let's implement non restrictive validation.
     //if it is a property validate, if it isn't just set it
@@ -571,10 +571,10 @@
     $property_names = array_keys($properties);

     if(in_array($name, $property_names) && !$this->ignore_validation){
-
+
       $property_type = $properties[$name]['type'];
       $property_type_class = eck_get_property_type_class($property_type);
-
+
       if (!isset($value)) {
         $schema = $property_type_class::schema();
         if (isset($schema['default'])) {
@@ -585,7 +585,7 @@
         $this->property_values[$name] = $value;
       }
       else{
-        throw new Exception("Invalid value {$value} for property {$name} of type {$property_type} in
+        throw new Exception("Invalid value {$value} for property {$name} of type {$property_type} in
         Entity type: {$entity_type_name}");
       }

@@ -603,7 +603,7 @@
     }
     return NULL;
   }
-
+
   public function __isset($name) {
     if(array_key_exists($name, $this->property_values)){
       return TRUE;
@@ -612,12 +612,12 @@
     }
     return FALSE;
   }
-
+
   public function save(){
     //going back to public properties
     $this->ignore_validation = TRUE;
     foreach($this->property_values as $property => $value){
-      $this->{$property} = $value;
+      $this->{$property} = $value;
     }
     return parent::save();
   }
diff --git a/eck.entity.inc b/eck.entity.inc
index f9b0c34..e203d97 100644
--- a/eck.entity.inc
+++ b/eck.entity.inc
@@ -17,7 +17,7 @@
 function eck__entity__menu($entity_type, $bundle) {
   $path = eck__entity_type__path();
   $menu = array();
-
+
   // DELETE Bundle
   $menu["{$path}/{$entity_type->name}/{$bundle->name}/delete"] = array(
     'title' => "Delete",
@@ -32,7 +32,7 @@
     'file' => 'eck.bundle.inc',
     'type' => MENU_LOCAL_TASK
   );
-
+
   $menu["{$path}/{$entity_type->name}/{$bundle->name}/edit"] = array(
     'title' => 'Edit',
     'page callback' => 'drupal_get_form',
@@ -48,7 +48,7 @@
   );

   // Managing a bundle's properties as extra fields
-
+
   $menu["{$path}/{$entity_type->name}/{$bundle->name}/properties/%"] = array(
     'title arguments' => array(6),
     'page callback' => 'drupal_get_form',
@@ -61,7 +61,7 @@
                                       ) ),
     'file' => 'eck.bundle.inc',
   );
-
+
   $menu["{$path}/{$entity_type->name}/{$bundle->name}/properties/%/edit"] = array(
     'title' => 'Edit',
     'type' => MENU_DEFAULT_LOCAL_TASK,
@@ -82,7 +82,7 @@
     'type' => MENU_LOCAL_TASK,
     'weight' => 5,
   );
-
+
   $menu["{$path}/{$entity_type->name}/{$bundle->name}/properties/%/remove"] = array(
     'title' => 'Remove',
     'page callback' => 'drupal_get_form',
@@ -110,9 +110,9 @@
     'access arguments' => array("autocomplete {$entity_type->name} {$bundle->name} bundle"),
     'file' => 'eck.bundle.inc'
   );*/
-
+
   $admin_info = get_bundle_admin_info($entity_type->name, $bundle->name);
-
+
   // OVERVIEW Entity
   $menu[$admin_info['path']] = array(
     'title' => "{$bundle->label}",
@@ -120,19 +120,19 @@
     'page callback' => "eck__entity__list",
     'page arguments' => array($entity_type->name, $bundle->name),
     'access callback' => 'eck__multiple_access_check',
-    'access arguments' => array(
-      array(
+    'access arguments' => array(
+      array(
         'eck administer bundles',
         'eck add bundles',
         'eck edit bundles',
         "eck administer {$entity_type->name} bundles",
         "eck add {$entity_type->name} bundles",
         "eck edit {$entity_type->name} bundles",
-        'eck administer entities',
+        'eck administer entities',
         "eck list entities",
         "eck administer {$entity_type->name} {$bundle->name} entities",
         "eck list {$entity_type->name} {$bundle->name} entities"
-      )
+      )
     ),
     'weight' => 0,
     'file' => 'eck.entity.inc'
@@ -143,21 +143,21 @@
     'type' => MENU_DEFAULT_LOCAL_TASK,
     'weight' => 100
   );
-
+
   $crud_info = get_bundle_crud_info($entity_type->name, $bundle->name);
-
+
   foreach($crud_info as $action => $info){
-
+
     $action_label = ucfirst($action);
     $args = array();
-
+
     if(array_key_exists('entity_id', $info)){
       $args[] = $info['entity_id'];
     }
-
+
     $args = array_merge(array($entity_type->name, $bundle->name), $args);
     $access_args = array_merge(array($action), $args);
-
+
     $menu[$info['path']] = array(
       'title' => "{$action_label} {$bundle->label}",
       'description' => "{$action_label} an entity of type {$entity_type->label} with bundle {$bundle->label}",
@@ -167,17 +167,17 @@
       'access arguments' => $access_args,
       'file' => 'eck.entity.inc',
     );
-
+
     //I think it would be useful to have the edit, delete, and list tabs at the view also
     //But lets leave this out for right now
     if($action == 'view'){
-
+
       $menu[$info['path']."/view"] = array(
         'title' => "View",
         'type' => MENU_DEFAULT_LOCAL_TASK,
         'weight' => 0
       );
-
+
      /* $menu[$info['path']."/list"] = array(
         'title' => "List",
         'description' => "View all entites of type {$entity_type->label} with bundle {$bundle->label}",
@@ -188,16 +188,16 @@
         'file' => 'eck.entity.inc',
         'type' => MENU_LOCAL_TASK
       );*/
-
+
        $weight = 1;
       foreach($crud_info as $a => $i){
-
+
         if($a != 'view' && $a != 'add' && $a !="list"){
           $al = ucfirst($a);
-
+
           $view_path = $info['path']."/{$a}";
           $access_args = array_merge(array($a), $args);
-
+
           $menu[$view_path] = array(
             'title' => "{$al}",
             'description' => "{$action_label} an entity of type {$entity_type->label} with bundle {$bundle->label}",
@@ -207,7 +207,7 @@
             'access arguments' => $access_args,
             'file' => 'eck.entity.inc',
             'type' => MENU_LOCAL_TASK,
-            'context' => (MENU_CONTEXT_PAGE|MENU_CONTEXT_INLINE),
+            'context' => (MENU_CONTEXT_PAGE|MENU_CONTEXT_INLINE),
             'weight' => $weight
           );
           $weight++;
@@ -216,14 +216,14 @@
     }
     //Holy Crap What a mess @todo clean up ^^
   }
-
+
   return $menu;
 }

 //a few helper function to get data our of the info array
 function get_bundle_admin_info($entity_type, $bundle){
   $info = entity_get_info();
-
+
   return $info[$entity_type]['bundles'][$bundle]['admin'];
 }
 function get_bundle_crud_info($entity_type_name, $bundle_name){
@@ -240,10 +240,10 @@
  *  (String) Bundle
  */
 function eck__entity__list($entity_type_name, $bundle_name) {
-
+
   $entity_type = entity_type_load($entity_type_name);
   $bundle = bundle_load($entity_type_name, $bundle_name);
-
+
   $info['entity_type'] = $entity_type->name;
   $info['bundle'] = $bundle->name;

@@ -256,22 +256,22 @@
   ->entityCondition('entity_type', $entity_type->name, '=')
   ->entityCondition('bundle', $bundle->name, '=')
   ->pager(20);
-
-
+
+
   drupal_alter('entity_overview_query', $query, $info);
   unset($info['entity_type']);
   drupal_alter("entity_{$entity_type->name}_overview_query", $query, $info);
   drupal_alter("entity_{$entity_type->name}_{$bundle->name}_overview_query", $query);
-
+
   $results = $query->execute();
   if(!empty($results)){
     $entities = entity_load($entity_type->name, array_keys($results[$entity_type->name]));
   }else{
     $entities = array();
   }
-
+
   $destination = drupal_get_destination();
-
+
   //Because of the flexible paths capabilities, we are not guaranteed to see a local action for the add here,
   //so lets add a link ourselves until we figure out whether there is a better solution
   $crud_info = get_bundle_crud_info($entity_type->name, $bundle->name);
@@ -281,12 +281,12 @@

   //Check that the user has permissions to view entity lists:
   if( eck__multiple_access_check(
-      array( 'eck administer entities',
+      array( 'eck administer entities',
              'eck list entities',
              "eck administer {$entity_type->name} {$bundle->name} entities",
              "eck list {$entity_type->name} {$bundle->name} entities"
   ) ) )
-
+
   $build['table'] = entity_table($entities, TRUE);
   $build['pager'] = array('#theme' => 'pager');

@@ -304,8 +304,9 @@
 function eck__entity__add($entity_type_name, $bundle_name) {
   $entity_type = entity_type_load($entity_type_name);
   $bundle = bundle_load($entity_type_name, $bundle_name);
-
+
   $entity = entity_create($entity_type->name, array('type' => $bundle->name));
+  //module_invoke_all('eck_entity_prepare', $entity_type_name, $entity);
   return drupal_get_form("eck__entity__form_add_{$entity_type_name}_{$bundle_name}", $entity);
 }

@@ -319,7 +320,7 @@
  */
 function eck__entity__build($entity_type, $bundle, $id) {
   if (is_numeric($id)) {
-
+
     $entities = entity_load($entity_type->name, array($id));
     if(array_key_exists($id, $entities)){
      $entity = $entities[$id];
@@ -330,7 +331,7 @@
     drupal_not_found();
     exit();
   }
-
+
   if(!$entity){
     drupal_not_found();
     exit();
@@ -382,12 +383,12 @@
   $entity_type = entity_type_load($entity_type_name);
   $bundle = bundle_load($entity_type_name, $bundle_name);
   return drupal_get_form('eck__entity__delete_form', $entity_type, $bundle, $id);
-
+
 }

 function eck__entity__delete_form($form, &$form_state, $entity_type, $bundle, $id){
   $path = eck__entity_type__path();
-
+
   $entities = entity_load($entity_type->name, array($id));

   $form['entity'] =
@@ -420,7 +421,7 @@
   $caption = t("This action cannot be undone.");

   return confirm_form($form, $message, "{$path}/{$entity_type->name}", $caption, t('Delete'));
-
+
 }

 /**
@@ -460,7 +461,7 @@
     '#type' => 'value',
     '#value' => $entity
   );
-
+
   // Property Widget Handling
   $entity_type = entity_type_load($entity->entityType());
   $bundle = bundle_load($entity_type->name, $entity->type);
@@ -488,7 +489,7 @@
     if (function_exists('drupal_get_path') && $widget_type['file']) {
       form_load_include($form_state, $widget_type['file type'], $widget_type['module'], $widget_type['file']);
     }
-
+
     $function = $widget_type['module'] . '_eck_property_widget_form';
     if (function_exists($function)) {
       $element = array(
@@ -522,7 +523,7 @@
   // TODO: Can probably integrate this with the widget hooks and do away with this.
   $vars = array('entity' => $entity);
   $vars += $property_info;
-
+
   // Add the property forms to the entity form.
   if (!empty($properties)) {
     $form += $properties;
@@ -550,27 +551,27 @@
 function eck__entity__form_validate($form, &$state) {
   $entity = $state['values']['entity'];
   field_attach_form_validate($entity->entityType(), $entity, $form, $state);
-
+
   //lets validate our properties by trying to set them :)
   $entity_type_name = $entity->entityType();
   $entity_type = EntityType::loadByName($entity_type_name);
   $properties = $entity_type->properties;
-
+
   //If we find a value set for a property lets just set it
   foreach($properties as $property => $info){
     $form_value = _eck_form_property_value($state, $property);
-
+
     if(isset($form_value)){
-
+
       //@TODO This should be a widget hook not a behavior function
       $vars = array('data' => $form_value);
-      $data = eck_property_behavior_invoke_plugin($entity_type, 'pre_set',
+      $data = eck_property_behavior_invoke_plugin($entity_type, 'pre_set',
       $vars);
-
+
       if(array_key_exists($property, $data)){
         $form_value = $data[$property];
       }
-
+
       try{
         $entity->{$property} = $form_value;
       }catch(Exception $e){
@@ -578,7 +579,7 @@
         form_set_error($property, "Invalid property value {$form_value}, value should be of type {$info['type']}");
       }
     }
-  }
+  }
 }

 /**
@@ -591,12 +592,12 @@
  */
 function eck__entity__form_submit($form, &$state) {
   $entity = $state['values']['entity'];
-
+
   field_attach_submit($entity->entityType(), $entity, $form, $state);
-
+
   $entity->save();

-  drupal_set_message(t("Entity {$entity->id} - @entity_label has been saved", array("@entity_label" => entity_label($form['#entity_type'], $entity)) ));
+  drupal_set_message(t("Entity @entity_id - @entity_label has been saved", array("@entity_id" => $entity->id, "@entity_label" => entity_label($form['#entity_type'], $entity)) ));
   $uri = eck__entity__uri($entity);
   $state['redirect'] = $uri['path'];
 }
@@ -614,27 +615,27 @@
 function eck__entity__view($entity_type_name, $bundle_name, $id) {
   $entity = entity_load($entity_type_name, array($id));
   $entity = $entity[$id];
-
+
   $entity_type = entity_type_load($entity_type_name);
   $properties = $entity_type->properties;
   $bundle = bundle_load($entity_type_name, $bundle_name);
-
+
   $build = array();
   $entity_view = eck__entity__build($entity_type, $bundle, $id);
   $property_view = array();
-
-  $formatters = eck_property_behavior_invoke_plugin($entity_type, 'default_formatter',
+
+  $formatters = eck_property_behavior_invoke_plugin($entity_type, 'default_formatter',
     array('entity' => $entity));
-
+
   foreach($formatters as $property => $formatter){
     $property_view[$property] = $formatter;
   }
-
+
   $entity_view[$entity->entityType()][$entity->id] = array_merge($property_view, $entity_view[$entity->entityType()][$entity->id]);
-
+
   eck_property_behavior_invoke_plugin($entity_type, 'entity_view',
     array('entity' => $entity));
-
+
   $build["{$entity_type->name}_{$bundle->name}_page"] = $entity_view;

   return $build;
diff --git a/eck.features.inc b/eck.features.inc
index 475cbf7..dccc7f2 100644
--- a/eck.features.inc
+++ b/eck.features.inc
@@ -33,7 +33,7 @@
     $export['features']['eck_entity_type'][$entity_type] = $entity_type;
     $export['dependencies']['eck_entity_type'] = 'eck';
     //@TODO we need to add dependencies on the modules implementing the property behaviors
-    //currently they are all implemented by ECK but in the future, people might have their custom
+    //currently they are all implemented by ECK but in the future, people might have their custom
     //behaviors.. or we might have behaviors provided by contrib.
     $export['dependencies']['features'] = 'features';
   }
@@ -61,7 +61,7 @@
     //This data is being generated by ECK, so no need to export it
     //$entity_metadata = entity_metadata_wrapper($entity_type_name);
     $entity_type = EntityType::loadByName($entity_type_name);
-
+
     $elements['name'] = $entity_type->name;
     $elements['label'] = $entity_type->label;
     $elements['properties'] = $entity_type->properties;
@@ -87,7 +87,7 @@
  * Rebuilds eck entities from code defaults.
  */
 function eck_entity_type_features_rebuild($module) {
-
+
   if ($default_entities = features_get_default('eck_entity_type', $module)) {
     foreach ($default_entities as $entity_type_name => $entity_type_info) {

@@ -210,29 +210,30 @@
     'entity_type' => NULL,
     'name' => NULL,
     'label' => NULL,
+    'config' => NULL,
   );
   $output =  array();
   $output[] = '  $items = array(';
-
+
   foreach($data as $bundle_machine_name){
     $bundle = Bundle::loadByMachineName($bundle_machine_name);
     unset($bundle->id);
-
+
     foreach($elements as $key => $value){
       $elements[$key] = $bundle->{$key};
     }
-
+
     // @TODO: Can entities exist without bundles?
     // Yes they can, but in ECK (as it is right now) all entities start with a bundle
     //I believe you can delete all the bundles from an entity type and everything would still
     //work, but I have not tried it.
-
+
     $output[] = "  '{$bundle->machine_name}' => ". features_var_export($elements) .",";
   }
-
+
   $output[] = '  );';

-
+
   $output[] = '  return $items;';

    return array('eck_bundle_info' => implode("\n", $output));
diff --git a/eck.info b/eck.info
index e6b8efa..600ea26 100644
--- a/eck.info
+++ b/eck.info
@@ -13,4 +13,10 @@
 files[] = views/handlers/eck_views_handler_field_link_delete.inc

 ; Inline entity form integration
-files[] = includes/eck.inline_entity_form.inc
\ No newline at end of file
+files[] = includes/eck.inline_entity_form.inc
+; Information added by drupal.org packaging script on 2013-04-20
+version = "7.x-3.x-dev"
+core = "7.x"
+project = "eck"
+datestamp = "1366462488"
+
diff --git a/eck.module b/eck.module
index 07d235e..9fcb42b 100644
--- a/eck.module
+++ b/eck.module
@@ -64,28 +64,28 @@

 function eck_eck_default_properties(){
   $default_properties = array();
-
+
   $default_properties['title'] =
   array(
     'label' => "Title",
     'type' => "text",
     'behavior' => 'title'
   );
-
+
   $default_properties['uid'] =
   array(
     'label' => "Author",
     'type' => "integer",
     'behavior' => 'author'
   );
-
+
   $default_properties['created'] =
   array(
     'label' => "Created",
     'type' => "integer",
     'behavior' => 'created'
   );
-
+
   $default_properties['changed'] =
   array(
     'label' => "Changed",
@@ -98,7 +98,7 @@
     'type' => "language",
     'behavior' => 'language'
   );
-
+
   return $default_properties;
 }

@@ -162,28 +162,28 @@
  *  an object as returned by entity_load()
  */
 function eck__entity__uri($entity) {
-
+
   $ids = entity_extract_ids($entity->entityType(), $entity);

   module_load_include('inc', 'eck', 'eck.entity');
   $crud_info = get_bundle_crud_info($entity->entityType(), $entity->type);
   $view_path = str_replace('%', $ids[0], $crud_info['view']['path']);
-
+
   return array('path' => $view_path);
 }

 function eck_schema_alter(&$schema){
   //dpm($schema, "Schema Alter");
-
+
   if (db_table_exists('eck_entity_type')) {
-
+
     // When something requests an entity's info, the hook_schema is called to
     // get the information about the entity's table, so we need to provide that
     // information in the hook.

     // Get all the entity types that have been create (all the rows in eck_entity_type table).
     foreach (EntityType::loadAll() as $entity_type) {
-      // The function eck__entity_type__schema returns a schema for that entity type
+      // The function eck__entity_type__schema returns a schema for that entity type
       // given and entity_type object.
       $schema =
       array_merge($schema, array("eck_{$entity_type->name}" => eck__entity_type__schema($entity_type)));
@@ -204,22 +204,22 @@
   module_load_include('inc', 'eck', 'eck.entity');
   //This is information set up for each bundle in the hook_entity_info
   //look there for more details
-  $crud_info = NULL;
-
+  $crud_info = NULL;
+
   $rows = array();
   $header = array(t('Name'), array('data' => t('Operations'), 'colspan' => '1'));
-
+
   $info = NULL;
   foreach ($entities as $entity) {
     $info = array();
     $entity_type = $entity->entityType();
     $bundle = $entity->type;
     $id = $entity->id;
-
+
     if($crud_info == NULL){
       $crud_info = get_bundle_crud_info($entity_type, $bundle);
     }
-
+
     $allowed_operations = '';
     $destination = drupal_get_destination();
     //Check that the user has permissions to edit:
@@ -227,7 +227,7 @@
       $edit_path = str_replace('%', $id, $crud_info['edit']['path']);
       $allowed_operations = l(t('edit'), $edit_path, array('query' => $destination));
     }
-
+
     //Check that the user has permissions to delete:
     if (eck__entity_menu_access('delete', $entity_type, $bundle, $id)) {
       $delete_path = str_replace('%', $id, $crud_info['delete']['path']);
@@ -236,18 +236,18 @@
     $uri = entity_uri($entity_type, $entity);
     $row = array(l(entity_label($entity_type, $entity), $uri['path'], $uri['options']));
     $row[] = array('data' => $allowed_operations); //"admin/structure/eck/{$entity_type}/{$bundle}/{$id}/delete"));
-
+
     $info['entity'] = $entity;
     drupal_alter("entity_{$entity_type}_{$bundle}_tr", $row, $info);
     $info['bundle'] = $bundle;
     drupal_alter("entity_{$entity_type}_tr", $row, $info);
     $info['entity_type'] = $entity_type;
     drupal_alter("entity_tr", $row, $info);
-
-
+
+
     $rows[$id] = $row;
   }
-
+
   if($info){
     unset($info['entity']);
     drupal_alter("entity_th", $header, $info);
@@ -290,13 +290,13 @@
 }

 function eck_entity_info_alter(&$info){
-
+
   foreach (EntityType::loadAll() as $entity_type) {
     $entity_type_info = $info[$entity_type->name];
-
+
     $entity_type_info =
     eck_property_behavior_invoke_plugin_alter($entity_type, 'entity_info',$entity_type_info);
-
+
     if($entity_type_info){
       $info[$entity_type->name] = $entity_type_info;
     }
@@ -353,7 +353,7 @@
   $o = EntityType::loadAll();
   dpm($o);
   dpm(entity_get_property_info(), "All Property Info");
-
+
   return "Hello";
 }

@@ -364,7 +364,7 @@
   // Add meta-data about the basic node properties.
   //$properties = &$info['entity_type']['properties'];
   foreach(EntityType::loadAll() as $entity_type){
-
+
     $properties = $entity_type->properties;
     $stuff = entity_metadata_convert_schema("eck_{$entity_type->name}");
     foreach($stuff as $key => $property){
@@ -380,7 +380,7 @@
       //specific entity_type
       drupal_alter("entity_property_{$key}_info", $property);
       drupal_alter("entity_property_{$entity_type->name}_{$key}_info", $property);
-
+
       if ($key == 'type') {
         $property['label'] = t('!entity_type type', array('!entity_type' => $entity_type->name));
         $property['type']  = 'token';
@@ -392,22 +392,22 @@
     }
     $info[$entity_type->name]['properties'] = $stuff;
   }
-
-  return $info;
+
+  return $info;
 }

 function eck_entity_property_info_alter(&$info){
-
+
   foreach (EntityType::loadAll() as $entity_type) {
     $entity_property_info = $info[$entity_type->name];
-
+
     $entity_property_info =
     eck_property_behavior_invoke_plugin_alter($entity_type, 'property_info',$entity_property_info);
-
+
     foreach($entity_type->properties as $property => $stuff){
       foreach(array('setter', 'getter', 'validation') as $function_name){
         if(eck_property_behavior_implements($entity_type, $property, $function_name)){
-          $entity_property_info['properties'][$property] ["{$function_name} callback"]
+          $entity_property_info['properties'][$property] ["{$function_name} callback"]
             = "eck_property_behavior_{$function_name}";
         }
       }
@@ -468,13 +468,13 @@
  */
 /*function eck_entity_property_info_alter(&$info) {
   module_load_include('inc', 'eck', 'eck.entity_type');
-
+
   dpm($info, "Property Info");
   // Create property infos for all defined entites.
   foreach (eck__entity_type__load() as $entity_type_object) {
     eck__entity_type__property_info($info[$entity_type_object->name], $entity_type_object);
   }
-
+
 }*/

 /**
@@ -489,9 +489,9 @@
  * that need to be created
  */
 function eck_menu() {
-
+
   $menu = array();
-
+
   module_load_include('inc', 'eck', 'eck.entity_type');
   $menu = array_merge(eck__entity_type__menu(), $menu);
   return $menu;
@@ -505,10 +505,10 @@
  * and for each action of the CRUD
  */
 function eck_permission() {
-
+
   module_load_include('inc', 'eck', 'eck.entity_type');
   module_load_include('inc', 'eck', 'eck.bundle');
-
+
   $perms = array(
     //Entity Type permissions:
     'eck administer entity types' => array(
@@ -663,7 +663,7 @@
       'callback' => 'entity_table_select'
     );
   }
-
+
   else if (strpos($form_id, 'eck__entity__form_') === 0) {
     $forms[$form_id] = array(
       'callback' => 'eck__entity__form'
@@ -767,7 +767,7 @@
 }*/
 /**
  * Retrieve the entity label
- *
+ *
  * @todo Where am I using this??
  */
 /*function eck_get_entity_label($entity_type, $entity_id) {
@@ -821,7 +821,7 @@
      dpm($result);
     if (!empty($this->entityInfo['entity class']) && $result->rowCount()) {
       $row = $result->fetch(PDO::FETCH_ASSOC);
-
+

       // Allow to create custom per-bundle specific class implementations.
       $class_name = eck_get_class_name($row['type'], 'EntityType');
@@ -884,7 +884,7 @@
  * @param $widget_type
  *   (optional) A widget type name. If omitted, all widget types will be
  *   returned.
- *
+ *
  * @param $reset
  *   Forces rebuild of the property widget cache.
  *
@@ -948,29 +948,29 @@

 /**
  * Implementation of hook_eck_property_widget_info().
- *
+ *
  * Defines some default property widgets that come with ECK.
- *
+ *
  * @see eck_property_info_widget_types().
  **/
 function eck_eck_property_widget_info() {
   $widget_types = array();
-
+
   $widget_types['text'] = array(
     'label' => t('Text'),
     'settings' => array('size' => 60, 'max_length' => 255),
     'property types' => array('text', "integer", "positive_integer", "decimal"),
     'file' => 'eck.property_widgets',
   );
-
+
   $widget_types['options'] = array(
     'label' => t('Options'),
     'settings' => array('options' => ""),
     'property types' => array('text', "integer", "positive_integer", "decimal"),
     'file' => 'eck.property_widgets',
   );
-
-
+
+
   return $widget_types;
 }

@@ -1215,40 +1215,40 @@
 //Entity Hooks
 function eck_entity_presave($entity, $entity_type){
   $entity_type = EntityType::loadByName($entity_type);
-
+
   //this is an eck entity
   if($entity_type){
-    eck_property_behavior_invoke_plugin($entity_type, 'entity_save',
+    eck_property_behavior_invoke_plugin($entity_type, 'entity_save',
       array('entity' => $entity));
   }
 }

 function eck_entity_insert($entity, $entity_type){
   $entity_type = EntityType::loadByName($entity_type);
-
+
   //this is an eck entity
   if($entity_type){
-    eck_property_behavior_invoke_plugin($entity_type, 'entity_insert',
+    eck_property_behavior_invoke_plugin($entity_type, 'entity_insert',
       array('entity' => $entity));
   }
 }

 function eck_entity_update($entity, $entity_type){
   $entity_type = EntityType::loadByName($entity_type);
-
+
   //this is an eck entity
   if($entity_type){
-    eck_property_behavior_invoke_plugin($entity_type, 'entity_update',
+    eck_property_behavior_invoke_plugin($entity_type, 'entity_update',
       array('entity' => $entity));
   }
 }

 function eck_entity_delete($entity, $entity_type){
   $entity_type = EntityType::loadByName($entity_type);
-
+
   //this is an eck entity
   if($entity_type){
-    eck_property_behavior_invoke_plugin($entity_type, 'entity_delete',
+    eck_property_behavior_invoke_plugin($entity_type, 'entity_delete',
       array('entity' => $entity));
   }
 }
@@ -1367,23 +1367,25 @@
     $permissions[] = "eck administer {$entity_type_name} {$bundle_name} entities";
     $permissions[] = "eck {$op} {$entity_type_name} {$bundle_name} entities";
   }
-  return eck__multiple_access_check($permissions, FALSE /*TODO: should auto-load entity author here. */, $account);
+    $access = eck__multiple_access_check($permissions, FALSE /*TODO: should auto-load entity author here. */, $account);
+  drupal_alter("eck_entity_{$entity_type_name}_access", $access, $entity_or_bundle, $op, $account);
+  return $access;
 }

 function eck_entity_view_alter(&$view){
   $entity_types = EntityType::loadAll();
-
+
   $this_entity_type = $view['#entity_type'];
-
+
   foreach($entity_types as $et){
     if($et->name == $this_entity_type){
       $entity = $view['#entity'];
       $this_bundle = $entity->type;
       //lets add contextual links to our entities
-      //In eck you can change the paths of any of the possible operations,
+      //In eck you can change the paths of any of the possible operations,
       //since contextual links are dependent on the hierarchy of those paths,
       //changing the paths could cause of contextual links not to work correctly
-
+
       $view['#contextual_links']['eck'] =
       array(
         "{$this_entity_type}/{$this_bundle}",array($entity->id));
@@ -1392,37 +1394,37 @@
 }

 function eck_alphabetical_cmp( $a, $b )
-{
+{
   return strcasecmp($a->name, $b->name);
-}
+}

 function eck_eck_property_types(){
   $property_types = array();
-
+
   $property_types['decimal'] = array(
     'label' => t("Decimal"),
-    'class' => "DecimalPropertyType"
+    'class' => "DecimalPropertyType"
   );
   $property_types['integer'] = array(
     'label' => t("Integer"),
-    'class' => "IntegerPropertyType"
+    'class' => "IntegerPropertyType"
   );
   $property_types['positive_integer'] = array(
     'label' => t("Positive Integer"),
-    'class' => "PositiveIntegerPropertyType"
+    'class' => "PositiveIntegerPropertyType"
   );
   $property_types['text'] = array(
     'label' => t("Text"),
-    'class' => "TextPropertyType"
+    'class' => "TextPropertyType"
   );
   $property_types['language'] = array(
     'label' => t("Language"),
-    'class' => "LanguagePropertyType"
+    'class' => "LanguagePropertyType"
   );
   $property_types['uuid'] = array(
     'label' => t("UUID"),
-    'class' => "UUIDPropertyType"
+    'class' => "UUIDPropertyType"
   );
-
+
   return $property_types;
 }