fixed conditional issues with object properties, continued cleaning up formatting according to drupal standards
merging changes from origin