diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5e9863bafdf4271de3695943a72c7452898a85e4..27362ec8c6562504989f39aaa4874662793bdb49 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,84 @@
+2.0.0.0-dev58
+=============
+* Fixed bugs:
+  * Security improved for the Login, Update Cart, Add to Compare, Review, and Add entire wishlist actions on the frontend
+  * Removed warnings on category pages when Flat Catalog Category is enabled
+  * Fixed product price displayed in wrong currency after switching currency on the frontend
+  * Fixed the Save & Duplicate action in product creation
+  * Fixed big image scaling in product description
+  * Fixed admin dashboard styling issue
+  * Fixed validation message for the Quantity field on the product page in the backend
+  * Fixed the email template for sharing a Wishlist
+  * Fixed the response of the drop-down menu in the Plushe theme
+  * Fixed the missing Related Banners tab for Catalog Price Rule
+  * Fixed inability to enable the duplicated product
+  * Removed warnings on saving payment method configuration
+  * Fixed gift messages displaying on the Order View page after admin edits
+  * Fixed inability to create a new order status
+  * Fixed the behavior of the Save and Previous and the Previous buttons on the Edit Review page
+  * Fixed inability to delete a website if the number of websites is less or equal to two
+  * Fixed Export on the All Customers page
+  * Fixed inability to add products to the Shopping Cart from the Category page in Internet Explorer
+  * Fixed logo on the backend login page
+  * Fixed visual elements to indicate that Tax details can be expanded on the order creation page in the backend
+  * Fixed the CMS page preview design
+  * Fixed the newsletter template preview design
+  * Fixed the Matched Customers grid design in the Email Reminder Rules
+  * Fixed the theme version validation message displayed when creating a new theme
+  * Fixed performance degradation during installation wizard execution
+  * Fixed cron shell script
+  * Fixed user login on the frontend, when the Redirect Customer to Account Dashboard after Logging option is set to No
+  * Fixed errors in requests to shipping carrier (DHL International) when the shipping address contains letters with diacritic marks
+  * Fixed invalid account creation date
+  * Fixed displaying Product Alert links on product view page when the functionality is disabled
+  * Fixed the absence of some bundle options when configuring a bundle product in the Shopping Cart on the frontend
+  * Fixed the issue which allowed to view and cancel billing agreements belonging to another customer
+  * Fixed the content spoofing vulnerability when Solr was used
+  * Fixed a potential XSS vulnerability in customer login
+  * Fixed RSS feed for categories containing bundle product(s)
+  * Fixed inability to place an order with 3D Secure in Internet Explorer 10
+  * Fixed inability to place an order with PayPal Payflow Link and PayPal Payments Advanced
+  * Fixed integrity constraint violation in catalog URL rewrites
+  * Fixed the absence of the error when a wrong website code is specified during a website creation
+  * Fixed saving in the backend a new customer address, which contains new customer address attributes configured to be not visible on frontend
+  * Fixed USPS shipping method in the checkout
+  * Fixed placing orders with recurring profile items via PayPal Express Checkout
+  * Fixed email template creation in the backend
+  * Fixed the issue with default billing address being used instead of default shipping address during admin order creation
+  * Fixed inability to choose DB as Media Storage
+  * Fixed PHP issues found during the UI testing of the backend
+  * Fixed shipping label creation for USPS Priority Mail Shipping methods
+  * Fixed the issue which allowed to create customers with duplicate email
+  * Fixed the abstract product block error in the tier price template getter
+  * Fixed system message displaying in the backend
+  * Fixed the "404" error on customer review page
+  * Fixed autocomplete enabled on the admin login page
+  * Fixed the 3D Secure iframe
+  * Fixed the indicators of mandatory fields on the Package Extension page
+  * Fixed product image scaling on the Compare Products page
+  * Fixed product page design for products with the Fixed Product Tax attribute
+  * Removed spaces between parentheses and numbers in the Cart, Wishlist, and Compare Products blocks
+  * Fixed the message displaying the quantity for products found on the Advanced Search page
+  * Fixed incorrect caching of locale settings and URL settings during web installation
+  * Fixed inability to use a newly created store for admin user roles
+  * Fixed absence of the Advanced Search field on the frontend, when the Popular Search Terms functionality is disabled
+  * Fixed incorrect link to downloadable product(s) in the email invoice copy
+  * Fixed customs monetary value in labels/package info for international shipments
+  * Fixed importing for files with blank URL Key field on the store view level
+  * Fixed table rate error message
+  * Fixed frontend login without pre-set cookies
+  * Fixed date resetting to 1 Jan 1970 after saving a design change in the admin panel in case date format is DD/MM/YY
+  * Fixed CAPTCHA on multi-address checkout flow
+  * Fixed view files population tool
+* GitHub requests:
+  * [#122](https://github.com/magento/magento2/pull/122) -- Added support of federal units of Brazil with 27 states
+  * [#184](https://github.com/magento/magento2/issues/184) -- Removed unused blocks and methods in Magento_Wishlist module
+  * [#390](https://github.com/magento/magento2/pull/390) -- Support of alphanumeric order increment ids by the quote resource model
+* Themes update:
+  * Responsive design improvements
+* Improvements in code coverage calculation:
+  * Code coverage calculation approach for unit tests was changed from blacklist to whitelist
+
 2.0.0.0-dev57
 =============
 * Fixed bugs:
@@ -44,7 +125,7 @@
     * Session generic wrapper moved to library
     * Messages functionality moved from the Session model as separate component, message manager interface created
     * Sid resolver interface created to handle session sid from request
-  
+
 2.0.0.0-dev56
 =============
 * Fixed bugs:
diff --git a/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml b/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml
index 6e753a4ffcfd27bdb81de6cb7918b35b4ea20cfa..7544c90f6c0b4b73d88fe3940b515dd6409fa714 100644
--- a/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml
+++ b/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml
@@ -24,32 +24,28 @@
  */
 -->
 <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-    <referenceBlock name="root">
-        <container name="notifications" as="notifications" label="Notifications" after="header">
-            <block class="Magento\AdminNotification\Block\System\Messages" name="system_messages" as="system_messages" before="-" template="Magento_AdminNotification::system/messages.phtml"/>
-            <block class="Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup" name="unread_system_messages" as="unread_system_messages" after="system_messages" template="Magento_AdminNotification::system/messages/popup.phtml"/>
-            <block class="Magento\AdminNotification\Block\Window" name="notification_window" as="notification_window" acl="Magento_AdminNotification::show_toolbar" template="notification/window.phtml"/>
-        </container>
-        <referenceBlock name="head">
-            <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminnotification-system-notification-js">
-                <arguments>
-                    <argument name="file" xsi:type="string">Magento_AdminNotification::system/notification.js</argument>
-                </arguments>
-            </block>
-        </referenceBlock>
-    </referenceBlock>
+    <referenceContainer name="notifications">
+        <block class="Magento\AdminNotification\Block\System\Messages" name="system_messages" as="system_messages" before="-" template="Magento_AdminNotification::system/messages.phtml"/>
+        <block class="Magento\AdminNotification\Block\System\Messages\UnreadMessagePopup" name="unread_system_messages" as="unread_system_messages" after="system_messages" template="Magento_AdminNotification::system/messages/popup.phtml"/>
+        <block class="Magento\AdminNotification\Block\Window" name="notification_window" as="notification_window" acl="Magento_AdminNotification::show_toolbar" template="notification/window.phtml"/>
+    </referenceContainer>
     <referenceBlock name="header">
         <block class="Magento\AdminNotification\Block\ToolbarEntry" template="toolbar_entry.phtml" before="-"/>
     </referenceBlock>
     <referenceBlock name="head">
-        <block class="Magento\Theme\Block\Html\Head\Css" name="magento-core-prototype-magento-css">
+        <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminnotification-toolbar-entry-js" after="jquery-jquery-js">
             <arguments>
-                <argument name="file" xsi:type="string">Magento_Core::prototype/magento.css</argument>
+                <argument name="file" xsi:type="string">Magento_AdminNotification::toolbar_entry.js</argument>
             </arguments>
         </block>
-        <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminnotification-toolbar-entry-js">
+        <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminnotification-system-notification-js" after="jquery-jquery-js">
             <arguments>
-                <argument name="file" xsi:type="string">Magento_AdminNotification::toolbar_entry.js</argument>
+                <argument name="file" xsi:type="string">Magento_AdminNotification::system/notification.js</argument>
+            </arguments>
+        </block>
+        <block class="Magento\Theme\Block\Html\Head\Css" name="magento-core-prototype-magento-css">
+            <arguments>
+                <argument name="file" xsi:type="string">Magento_Core::prototype/magento.css</argument>
             </arguments>
         </block>
     </referenceBlock>
diff --git a/app/code/Magento/Authorizenet/view/frontend/directpost/form.phtml b/app/code/Magento/Authorizenet/view/frontend/directpost/form.phtml
index b2d202315fca546cdf8d30b5560ded69f5463cf8..4c65ada1da4e24f1df233118b8da0aad6e646298 100644
--- a/app/code/Magento/Authorizenet/view/frontend/directpost/form.phtml
+++ b/app/code/Magento/Authorizenet/view/frontend/directpost/form.phtml
@@ -56,7 +56,7 @@ $_orderUrl = $this->helper('Magento\Authorizenet\Helper\Data')->getPlaceOrderFro
         <div class="field required number">
             <label for="<?php echo $_code ?>_cc_number" class="label"><span><?php echo __('Credit Card Number') ?></span></label>
             <div class="control">
-                <input type="text" id="<?php echo $_code ?>_cc_number" data-container="cc-number" name="payment[cc_number]" title="<?php echo __('Credit Card Number') ?>" class="input-text" value="" data-validate='{required:true, "validate-cc-number":"#<?php echo $_code ?>_cc_type", "validate-cc-type":"#<?php echo $_code ?>_cc_type"}' autocomplete="off"/>
+                <input type="number" id="<?php echo $_code ?>_cc_number" data-container="cc-number" name="payment[cc_number]" title="<?php echo __('Credit Card Number') ?>" class="input-text" value="" data-validate='{required:true, "validate-cc-number":"#<?php echo $_code ?>_cc_type", "validate-cc-type":"#<?php echo $_code ?>_cc_type"}' autocomplete="off"/>
             </div>
         </div>
         <div class="field required date" id="<?php echo $_code ?>_cc_type_exp_div">
@@ -90,7 +90,7 @@ $_orderUrl = $this->helper('Magento\Authorizenet\Helper\Data')->getPlaceOrderFro
         <div class="field required cvv" id="<?php echo $_code ?>_cc_type_cvv_div">
             <label for="<?php echo $_code ?>_cc_cid" class="label"><span><?php echo __('Card Verification Number') ?></span></label>
             <div class="control">
-                <input type="text" title="<?php echo __('Card Verification Number') ?>" data-container="cc-cvv" class="input-text cvv" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" data-validate='{required:true, "validate-cc-cvn":"#<?php echo $_code ?>_cc_type"}' autocomplete="off"/>
+                <input type="number" title="<?php echo __('Card Verification Number') ?>" data-container="cc-cvv" class="input-text cvv" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" data-validate='{required:true, "validate-cc-cvn":"#<?php echo $_code ?>_cc_type"}' autocomplete="off"/>
                 <div class="note">
                     <a href="#" id="directpost-cvv-what-is-this" class="action cvv" data-mage-init='{toggleAdvanced: {toggleContainers:"#directpost-tool-tip"}}'><span><?php echo __('What is this?') ?></span></a>
                 </div>
diff --git a/app/code/Magento/Backend/App/AbstractAction.php b/app/code/Magento/Backend/App/AbstractAction.php
index 3628ae730a23502de6043196a85daf5cb74d4c43..33a91d89cfce1ebf888c79a66cfc3d5bb71997f7 100644
--- a/app/code/Magento/Backend/App/AbstractAction.php
+++ b/app/code/Magento/Backend/App/AbstractAction.php
@@ -381,23 +381,4 @@ abstract class AbstractAction extends \Magento\App\Action\Action
         }
         return true;
     }
-
-    /**
-     * Render specified template
-     *
-     * @param string $tplName
-     * @param array $data parameters required by template
-     */
-    protected function _outTemplate($tplName, $data = array())
-    {
-        $this->_view->getLayout()->initMessages();
-        $block = $this->_view->getLayout()
-            ->createBlock('Magento\Backend\Block\Template')->setTemplate("{$tplName}.phtml");
-        foreach ($data as $index => $value) {
-            $block->assign($index, $value);
-        }
-        $html = $block->toHtml();
-        $this->_objectManager->get('Magento\Core\Model\Translate')->processResponseBody($html);
-        $this->getResponse()->setBody($html);
-    }
 }
diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage.php
index 327a5432a94bdd903194c27f86d2e44697997e25..65b03db650f2be79efa80892b1b7339e98ff76d7 100644
--- a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage.php
+++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/System/Storage.php
@@ -64,7 +64,9 @@ class Storage extends \Magento\Backend\App\Action
     {
         session_write_close();
 
-        if (!isset($_REQUEST['storage'])) {
+        $requestStorage = $this->getRequest()->getParam('storage');
+        $requestConnection = $this->getRequest()->getParam('connection');
+        if (!isset($requestStorage)) {
             return;
         }
 
@@ -80,9 +82,9 @@ class Storage extends \Magento\Backend\App\Action
             ->setFlagData(array())
             ->save();
 
-        $storage = array('type' => (int) $_REQUEST['storage']);
-        if (isset($_REQUEST['connection']) && !empty($_REQUEST['connection'])) {
-            $storage['connection'] = $_REQUEST['connection'];
+        $storage = array('type' => $requestStorage);
+        if (isset($requestConnection) && !empty($requestConnection)) {
+            $storage['connection'] = $requestConnection;
         }
 
         try {
diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php
index 787ec2188c1022a0ff76248f1c18b6b42fbe5251..3428a47dac3a582f8188cdc53380554be77ed285 100644
--- a/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php
+++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Design.php
@@ -35,15 +35,23 @@ class Design extends \Magento\Backend\App\Action
      */
     protected $_coreRegistry = null;
 
+    /**
+     * @var \Magento\Core\Filter\Date
+     */
+    protected $dateFilter;
+
     /**
      * @param \Magento\Backend\App\Action\Context $context
      * @param \Magento\Core\Model\Registry $coreRegistry
+     * @param \Magento\Core\Filter\Date $dateFilter
      */
     public function __construct(
         \Magento\Backend\App\Action\Context $context,
-        \Magento\Core\Model\Registry $coreRegistry
+        \Magento\Core\Model\Registry $coreRegistry,
+        \Magento\Core\Filter\Date $dateFilter
     ) {
         $this->_coreRegistry = $coreRegistry;
+        $this->dateFilter = $dateFilter;
         parent::__construct($context);
     }
 
@@ -86,7 +94,9 @@ class Design extends \Magento\Backend\App\Action
         $this->_coreRegistry->register('design', $design);
 
         $this->_addContent($this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Design\Edit'));
-        $this->_addLeft($this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Design\Edit\Tabs', 'design_tabs'));
+        $this->_addLeft(
+            $this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Design\Edit\Tabs', 'design_tabs')
+        );
 
         $this->_view->renderLayout();
     }
@@ -95,6 +105,7 @@ class Design extends \Magento\Backend\App\Action
     {
         $data = $this->getRequest()->getPost();
         if ($data) {
+            $data['design'] = $this->_filterPostData($data['design']);
             $id = (int) $this->getRequest()->getParam('id');
 
             $design = $this->_objectManager->create('Magento\Core\Model\Design');
@@ -143,4 +154,18 @@ class Design extends \Magento\Backend\App\Action
     {
         return $this->_authorization->isAllowed('Magento_Adminhtml::design');
     }
+
+    /**
+     * Filtering posted data. Converting localized data if needed
+     *
+     * @param array
+     * @return array
+     */
+    protected function _filterPostData($data)
+    {
+        $inputFilter = new \Zend_Filter_Input(
+            array('date_from' => $this->dateFilter, 'date_to' => $this->dateFilter), array(), $data);
+        $data = $inputFilter->getUnescaped();
+        return $data;
+    }
 }
diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php
index fb27a38d8f41bdd4b942d4927fab0998a1f229ea..94acf1592ff65634d75be0273506b49f5f50674a 100644
--- a/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php
+++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Store.php
@@ -255,7 +255,7 @@ class Store extends \Magento\Backend\App\Action
                 $this->_redirect('adminhtml/*/');
                 return;
             } catch (\Magento\Core\Exception $e) {
-                $this->messageManager->addMessages($e->getMessages());
+                $this->messageManager->addError($e->getMessage());
                 $this->_getSession()->setPostData($postData);
             } catch (\Exception $e) {
                 $this->messageManager->addException($e, __('An error occurred while saving. Please review the error log.'));
diff --git a/app/code/Magento/Backend/Model/Auth/Session.php b/app/code/Magento/Backend/Model/Auth/Session.php
index 9b21e4e7d35e5460176239fad7f3103cc2f47661..521343315ce8fdc3690c8d5d96abac74046fabc7 100644
--- a/app/code/Magento/Backend/Model/Auth/Session.php
+++ b/app/code/Magento/Backend/Model/Auth/Session.php
@@ -29,6 +29,13 @@ namespace Magento\Backend\Model\Auth;
 /**
  * Backend Auth session model
  *
+ * @method \Magento\User\Model\User|null getUser()
+ * @method \Magento\Backend\Model\Auth\Session setUser(\Magento\User\Model\User $value)
+ * @method \Magento\Acl|null getAcl()
+ * @method \Magento\Backend\Model\Auth\Session setAcl(\Magento\Acl $value)
+ * @method int getUpdatedAt()
+ * @method \Magento\Backend\Model\Auth\Session setUpdatedAt(int $value)
+ *
  * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
  * @todo implement solution that keeps is_first_visit flag in session during redirects
  */
diff --git a/app/code/Magento/Backend/view/adminhtml/admin/login.phtml b/app/code/Magento/Backend/view/adminhtml/admin/login.phtml
index af9150cbc8986d2669a69a870cdfc49ff846f7c8..d54559f710f8a595f32c56db632bf4927e723a7a 100644
--- a/app/code/Magento/Backend/view/adminhtml/admin/login.phtml
+++ b/app/code/Magento/Backend/view/adminhtml/admin/login.phtml
@@ -68,7 +68,7 @@
                 <div id="messages" data-container-for="messages">
                     <?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?>
                 </div>
-                <form method="post" action="" id="login-form">
+                <form method="post" action="" id="login-form" autocomplete="off">
                     <fieldset class="fieldset">
                         <legend class="legend"><span><?php echo __('Welcome') ?></span></legend><br/>
                         <input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />
@@ -81,6 +81,8 @@
                         <div class="field field-password">
                             <label for="login" class="label"><?php echo __('Password:') ?></label>
                             <div class="control">
+                                <!-- This is a dummy hidden field to trick firefox from auto filling the password -->
+                                <input type="text" class="input-text no-display" name="dummy" id="dummy" />
                                 <input type="password" id="login" name="login[password]" class="required-entry input-text" value="" placeholder="password" />
                             </div>
                         </div>
diff --git a/app/code/Magento/Backend/view/adminhtml/layout/default.xml b/app/code/Magento/Backend/view/adminhtml/layout/default.xml
index 488e6e96e742c002cb17c4627983b55e83407386..506f5802066240eb4b5b4988f126d5fadd7305e6 100644
--- a/app/code/Magento/Backend/view/adminhtml/layout/default.xml
+++ b/app/code/Magento/Backend/view/adminhtml/layout/default.xml
@@ -279,6 +279,7 @@
         <block class="Magento\Backend\Block\Page\Header" name="header" as="header">
             <block class="Magento\Backend\Block\GlobalSearch" as="search" acl="Magento_Adminhtml::global_search"/>
         </block>
+        <container name="notifications" as="notifications" label="Notifications"/>
         <block class="Magento\Backend\Block\Widget\Breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
         <!--<update handle="formkey"/> this won't work, see the try/catch and a jammed exception in \Magento\Core\Model\Layout::createBlock() -->
         <block class="Magento\Backend\Block\Admin\Formkey" name="formkey" as="formkey" template="Magento_Backend::admin/formkey.phtml"/>
diff --git a/app/code/Magento/Backend/view/adminhtml/system/config/system/storage/media/synchronize.phtml b/app/code/Magento/Backend/view/adminhtml/system/config/system/storage/media/synchronize.phtml
index f450da745e7c627ec6c7b2deb09ab92c546eefdd..9bb2c8e64fa41d238fe846118759cca565259618 100644
--- a/app/code/Magento/Backend/view/adminhtml/system/config/system/storage/media/synchronize.phtml
+++ b/app/code/Magento/Backend/view/adminhtml/system/config/system/storage/media/synchronize.phtml
@@ -32,10 +32,6 @@
     jQuery.mage.extend('validation', 'validation',
         '<?php echo $this->getViewFileUrl('Magento_Backend::system/validation-rules.js'); ?>');
 
-    defaultValues   = [];
-    defaultValues['system_media_storage_configuration_media_storage']   = $('system_media_storage_configuration_media_storage').value;
-    defaultValues['system_media_storage_configuration_media_database']  = $('system_media_storage_configuration_media_database').value;
-
     allowedStorages = [];
     addAllowedStorage(
         $('system_media_storage_configuration_media_storage').value,
@@ -45,6 +41,10 @@
     <?php $syncStorageParams = $this->getSyncStorageParams() ?>
     addAllowedStorage(<?php echo $syncStorageParams['storage_type'] ?>, '<?php echo $syncStorageParams['connection_name'] ?>');
 
+    defaultValues   = [];
+    defaultValues['system_media_storage_configuration_media_storage']   = $('system_media_storage_configuration_media_storage').value;
+    defaultValues['system_media_storage_configuration_media_database']  = $('system_media_storage_configuration_media_database').value;
+
     function getConnectionName(storageType, connection)
     {
         if (storageType == 0) {
@@ -63,6 +63,8 @@
         if (storage != '' && !allowedStorages.include(storage)) {
             allowedStorages.push(storage);
         }
+        $('system_media_storage_configuration_media_storage').value = storageType;
+        $('system_media_storage_configuration_media_database').value = connection;
     }
 
     function checkButtonState(event) {
@@ -77,7 +79,6 @@
             $('system_media_storage_configuration_media_storage').value,
             $('system_media_storage_configuration_media_database').value
         );
-
         if (defaultStorage != storage) {
             enableSyncButton();
         } else {
diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php
index 0db6c9ec5fe1cd86469acddb90d1a04befa149d1..db4e19690b27f7962fe9804ae07c157592159f84 100644
--- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php
+++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php
@@ -151,7 +151,7 @@ class Option extends \Magento\Bundle\Block\Catalog\Product\Price
     /**
      * Collect selected options
      *
-     * @return void
+     * @return mixed
      */
     protected function _getSelectedOptions()
     {
@@ -183,9 +183,9 @@ class Option extends \Magento\Bundle\Block\Catalog\Product\Price
     {
         $selectedOptions = $this->_getSelectedOptions();
         if (is_numeric($selectedOptions)) {
-            return ($selection->getSelectionId() == $this->_getSelectedOptions());
+            return ($selection->getSelectionId() == $selectedOptions);
         } elseif (is_array($selectedOptions) && !empty($selectedOptions)) {
-            return in_array($selection->getSelectionId(), $this->_getSelectedOptions());
+            return in_array($selection->getSelectionId(), $selectedOptions);
         } elseif ($selectedOptions == 'None') {
             return false;
         } else {
@@ -322,4 +322,16 @@ class Option extends \Magento\Bundle\Block\Catalog\Product\Price
 
         return $formated;
     }
+
+    /**
+     * Clear selected option when setting new option
+     *
+     * @param \Magento\Bundle\Model\Option $option
+     * @return mixed
+     */
+    public function setOption(\Magento\Bundle\Model\Option $option)
+    {
+        $this->_selectedOptions = null;
+        return parent::setOption($option);
+    }
 }
diff --git a/app/code/Magento/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/Magento/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php
index 90af8f4d1938b7a02f16b8a0037888717a074710..fe3c60dca0ce13c484c4f5e53945db9152b04644 100644
--- a/app/code/Magento/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php
+++ b/app/code/Magento/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php
@@ -24,6 +24,9 @@
  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
  */
 
+/** @var $installer \Magento\Catalog\Model\Resource\Setup */
+$installer = $this;
+
 /** @var $this \Magento\Catalog\Model\Resource\Setup */
 $installFile = __DIR__ . '/upgrade-1.6.0.0-1.6.0.0.1.php';
 
diff --git a/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml b/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml
index c808e6c31c41b2ce3cb6b801a9d197caba8102ae..b7fc1b41984207dede1c4a6ab7c67afa4c4da490 100644
--- a/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml
+++ b/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml
@@ -80,7 +80,7 @@
                     <input <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?>
                            id="bundle-option-<?php echo $_option->getId() ?>-qty-input"
                            class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>"
-                           type="text"
+                           type="number"
                            name="bundle_option_qty[<?php echo $_option->getId() ?>]"
                            value="<?php echo $_defaultQty ?>"/>
                 </div>
diff --git a/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml b/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml
index 52801328c7f053b9164c44e541ce8e07c0ef5a54..e9e1a9d02c3aec76d0eed89d76ee27e7e7cef018 100644
--- a/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml
+++ b/app/code/Magento/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml
@@ -62,7 +62,7 @@
                     <input <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?>
                            id="bundle-option-<?php echo $_option->getId() ?>-qty-input"
                            class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>"
-                           type="text"
+                           type="number"
                            name="bundle_option_qty[<?php echo $_option->getId() ?>]"
                            value="<?php echo $_defaultQty ?>"/>
                 </div>
diff --git a/app/code/Magento/Bundle/view/frontend/rss/catalog/product/price.phtml b/app/code/Magento/Bundle/view/frontend/rss/catalog/product/price.phtml
index e8ab7745d80e182d2a1da1423df51f3e1e6b5e5a..60c1e8ad9970f09baba7a4c26ec21748c837730b 100644
--- a/app/code/Magento/Bundle/view/frontend/rss/catalog/product/price.phtml
+++ b/app/code/Magento/Bundle/view/frontend/rss/catalog/product/price.phtml
@@ -32,7 +32,11 @@
 ?>
 
 <?php $_product = $this->getProduct() ?>
-<?php list($_minimalPrice, $_maximalPrice) = $_product->getPriceModel()->getPrices($_product) ?>
+<?php
+/** @var \Magento\Bundle\Model\Product\Price $_priceModel */
+$_priceModel = $_product->getPriceModel()
+?>
+<?php list($_minimalPrice, $_maximalPrice) = $_priceModel->getTotalPrices($_product) ?>
 <?php $_id = $_product->getId() ?>
 
 <?php $_weeeTaxAmount = 0; ?>
diff --git a/app/code/Magento/Captcha/Model/ModelInterface.php b/app/code/Magento/Captcha/Model/ModelInterface.php
index 0c8b5bdd658071befc1314b2883cbaad1c7943ff..d969e5540ee6a2528577df6ce7232ab3080732eb 100644
--- a/app/code/Magento/Captcha/Model/ModelInterface.php
+++ b/app/code/Magento/Captcha/Model/ModelInterface.php
@@ -42,7 +42,7 @@ interface ModelInterface
      *
      * @abstract
      * @param string $word
-     * @return void
+     * @return bool
      */
     public function isCorrect($word);
 
diff --git a/app/code/Magento/Captcha/Model/Observer.php b/app/code/Magento/Captcha/Model/Observer.php
index 59105886db4b081f676e90549fb6e2a5b0650884..55b78ec34649e744973cf4f0e1a52c70013ae8b2 100644
--- a/app/code/Magento/Captcha/Model/Observer.php
+++ b/app/code/Magento/Captcha/Model/Observer.php
@@ -93,6 +93,11 @@ class Observer
      */
     protected $messageManager;
 
+    /**
+     * @var \Magento\App\Response\RedirectInterface
+     */
+    protected $redirect;
+
     /**
      * @param Resource\LogFactory $resLogFactory
      * @param \Magento\Session\SessionManagerInterface $session
@@ -104,6 +109,9 @@ class Observer
      * @param \Magento\App\RequestInterface $request
      * @param \Magento\App\ActionFlag $actionFlag
      * @param \Magento\Message\ManagerInterface $messageManager
+     * @param \Magento\App\Response\RedirectInterface $redirect
+     *
+     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
      */
     public function __construct(
         \Magento\Captcha\Model\Resource\LogFactory $resLogFactory,
@@ -115,7 +123,8 @@ class Observer
         \Magento\Core\Model\Url $urlManager,
         \Magento\App\RequestInterface $request,
         \Magento\App\ActionFlag $actionFlag,
-        \Magento\Message\ManagerInterface $messageManager
+        \Magento\Message\ManagerInterface $messageManager,
+        \Magento\App\Response\RedirectInterface $redirect
     ) {
         $this->_resLogFactory = $resLogFactory;
         $this->_session = $session;
@@ -127,6 +136,7 @@ class Observer
         $this->_request = $request;
         $this->_actionFlag = $actionFlag;
         $this->messageManager = $messageManager;
+        $this->redirect = $redirect;
     }
 
     /**
@@ -145,7 +155,7 @@ class Observer
             if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) {
                 $this->messageManager->addError(__('Incorrect CAPTCHA'));
                 $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true);
-                $controller->getResponse()->setRedirect($this->_urlManager->getUrl('*/*/forgotpassword'));
+                $this->redirect->redirect($controller->getResponse(), '*/*/forgotpassword');
             }
         }
         return $this;
@@ -161,11 +171,12 @@ class Observer
         $formId = 'contact_us';
         $captcha = $this->_helper->getCaptcha($formId);
         if ($captcha->isRequired()) {
+            /** @var \Magento\App\Action\Action $controller */
             $controller = $observer->getControllerAction();
             if (!$captcha->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) {
                 $this->messageManager->addError(__('Incorrect CAPTCHA.'));
                 $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true);
-                $controller->getResponse()->setRedirect($this->_urlManager->getUrl('contacts/index/index'));
+                $this->redirect->redirect($controller->getResponse(), 'contacts/index/index');
             }
         }
     }
@@ -209,12 +220,14 @@ class Observer
         $formId = 'user_create';
         $captchaModel = $this->_helper->getCaptcha($formId);
         if ($captchaModel->isRequired()) {
+            /** @var \Magento\App\Action\Action $controller */
             $controller = $observer->getControllerAction();
             if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) {
                 $this->messageManager->addError(__('Incorrect CAPTCHA'));
                 $this->_actionFlag->set('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true);
                 $this->_session->setCustomerFormData($controller->getRequest()->getPost());
-                $controller->getResponse()->setRedirect($this->_urlManager->getUrl('*/*/create'));
+                $url = $this->_urlManager->getUrl('*/*/create', array('_nosecret' => true));
+                $controller->getResponse()->setRedirect($this->redirect->error($url));
             }
         }
         return $this;
diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php
index b336778eadc47ec9282e79f75c86a8b424ffd0f4..06eaf262645e9d38b0bc18e9b91772d799d51259 100644
--- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php
+++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php
@@ -43,6 +43,11 @@ class NewCategory extends \Magento\Backend\Block\Widget\Form\Generic
      */
     protected $_jsonEncoder;
 
+    /**
+     * @var \Magento\Catalog\Model\CategoryFactory
+     */
+    protected $_categoryFactory;
+
     /**
      * @param \Magento\Backend\Block\Template\Context $context
      * @param \Magento\Json\EncoderInterface $jsonEncoder
@@ -60,9 +65,9 @@ class NewCategory extends \Magento\Backend\Block\Widget\Form\Generic
         array $data = array()
     ) {
         $this->_jsonEncoder = $jsonEncoder;
+        $this->_categoryFactory = $categoryFactory;
         parent::__construct($context, $registry, $formFactory, $data);
         $this->setUseContainer(true);
-        $this->_categoryFactory = $categoryFactory;
     }
 
     /**
@@ -119,9 +124,13 @@ class NewCategory extends \Magento\Backend\Block\Widget\Form\Generic
             ->load()
             ->getItems();
 
-        return count($items) === 2
-            ? array($items[2]->getEntityId() => $items[2]->getName())
-            : array();
+        $result = array();
+        if (count($items) === 2) {
+            $item = array_pop($items);
+            $result = array($item->getEntityId() => $item->getName());
+        }
+
+        return $result;
     }
 
     /**
diff --git a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php
index 34a53c8ee89663b91728ea47cabd673846c8c81a..49ae70c174820cc991b88f5f00398df50c3ec1b7 100644
--- a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php
+++ b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php
@@ -87,7 +87,7 @@ abstract class AbstractProduct extends \Magento\View\Element\Template
      * @var \Magento\Core\Model\Registry
      */
     protected $_coreRegistry = null;
-    
+
     /**
      * Catalog data
      *
@@ -152,7 +152,7 @@ abstract class AbstractProduct extends \Magento\View\Element\Template
      * @param \Magento\Theme\Helper\Layout $layoutHelper
      * @param \Magento\Catalog\Helper\Image $imageHelper
      * @param array $data
-     * 
+     *
      * @SuppressWarnings(PHPMD.ExcessiveParameterList)
      */
     public function __construct(
@@ -399,6 +399,11 @@ abstract class AbstractProduct extends \Magento\View\Element\Template
         return $this->getData('product');
     }
 
+    /**
+     * Retrieve tier price template
+     *
+     * @return string
+     */
     public function getTierPriceTemplate()
     {
         if (!$this->hasData('tier_price_template')) {
@@ -407,6 +412,7 @@ abstract class AbstractProduct extends \Magento\View\Element\Template
 
         return $this->getData('tier_price_template');
     }
+
     /**
      * Returns product tier price block html
      *
@@ -421,7 +427,7 @@ abstract class AbstractProduct extends \Magento\View\Element\Template
         return $this->_getPriceBlock($product->getTypeId())
             ->setTemplate($this->getTierPriceTemplate())
             ->setProduct($product)
-            ->setInGrouped($this->getProduct()->isGrouped())
+            ->setInGrouped($product->isGrouped())
             ->toHtml();
     }
 
diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php
index dc4f438ecfc02f8a13d5f0186365c529a1b2e5e5..57f017a95aa11d8b51a75a5ef14b8fc4c263f125 100644
--- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php
+++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Review.php
@@ -169,7 +169,7 @@ class Review extends \Magento\Backend\App\Action
             $nextId = (int) $this->getRequest()->getParam('next_item');
             $url = $this->getUrl($this->getRequest()->getParam('ret') == 'pending' ? '*/*/pending' : '*/*/');
             if ($nextId) {
-                $url = $this->getUrl('adminhtml/*/edit', array('id' => $nextId));
+                $url = $this->getUrl('catalog/*/edit', array('id' => $nextId));
             }
             return $this->getResponse()->setRedirect($url);
         }
@@ -186,9 +186,9 @@ class Review extends \Magento\Backend\App\Action
 
             $this->messageManager->addSuccess(__('The review has been deleted.'));
             if( $this->getRequest()->getParam('ret') == 'pending' ) {
-                $this->getResponse()->setRedirect($this->getUrl('adminhtml/*/pending'));
+                $this->getResponse()->setRedirect($this->getUrl('catalog/*/pending'));
             } else {
-                $this->getResponse()->setRedirect($this->getUrl('adminhtml/*/'));
+                $this->getResponse()->setRedirect($this->getUrl('catalog/*/'));
             }
             return;
         } catch (\Magento\Core\Exception $e) {
diff --git a/app/code/Magento/Catalog/Controller/Product/Compare.php b/app/code/Magento/Catalog/Controller/Product/Compare.php
index 13521974c5cb2029efd6dd96fbb9bb626cee8a0d..180865bc597975aa9bf5f55f094fa91a48cad2b5 100644
--- a/app/code/Magento/Catalog/Controller/Product/Compare.php
+++ b/app/code/Magento/Catalog/Controller/Product/Compare.php
@@ -101,6 +101,11 @@ class Compare extends \Magento\App\Action\Action
      */
     protected $_storeManager;
 
+    /**
+     * @var \Magento\Core\App\Action\FormKeyValidator
+     */
+    protected $_formKeyValidator;
+
     /**
      * @param \Magento\App\Action\Context $context
      * @param \Magento\Customer\Model\CustomerFactory $customerFactory
@@ -123,7 +128,8 @@ class Compare extends \Magento\App\Action\Action
         \Magento\Log\Model\Visitor $logVisitor,
         \Magento\Catalog\Model\Product\Compare\ListCompare $catalogProductCompareList,
         \Magento\Catalog\Model\Session $catalogSession,
-        \Magento\Core\Model\StoreManagerInterface $storeManager
+        \Magento\Core\Model\StoreManagerInterface $storeManager,
+        \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
     ) {
         $this->_storeManager = $storeManager;
         $this->_customerFactory = $customerFactory;
@@ -134,6 +140,7 @@ class Compare extends \Magento\App\Action\Action
         $this->_logVisitor = $logVisitor;
         $this->_catalogProductCompareList = $catalogProductCompareList;
         $this->_catalogSession = $catalogSession;
+        $this->_formKeyValidator = $formKeyValidator;
         parent::__construct($context);
     }
 
@@ -168,6 +175,11 @@ class Compare extends \Magento\App\Action\Action
      */
     public function addAction()
     {
+        if (!$this->_formKeyValidator->validate($this->getRequest())) {
+            $this->getResponse()->setRedirect($this->_redirect->getRefererUrl());
+            return;
+        }
+
         $productId = (int)$this->getRequest()->getParam('product');
         if ($productId
             && ($this->_logVisitor->getId()
diff --git a/app/code/Magento/Catalog/Helper/Product/Compare.php b/app/code/Magento/Catalog/Helper/Product/Compare.php
index e73f82973e73acc5fe58a18fd9130e3585a0a9f8..1c1b16773601c169df31ab36c990e05080171e11 100644
--- a/app/code/Magento/Catalog/Helper/Product/Compare.php
+++ b/app/code/Magento/Catalog/Helper/Product/Compare.php
@@ -96,6 +96,11 @@ class Compare extends \Magento\Core\Helper\Url
      */
     protected $_itemCollectionFactory;
 
+    /**
+     * @var \Magento\Data\Form\FormKey
+     */
+    protected $_formKey;
+
     /**
      * @param \Magento\App\Helper\Context $context
      * @param \Magento\Core\Model\StoreManagerInterface $storeManager
@@ -104,6 +109,7 @@ class Compare extends \Magento\Core\Helper\Url
      * @param \Magento\Log\Model\Visitor $logVisitor
      * @param \Magento\Customer\Model\Session $customerSession
      * @param \Magento\Catalog\Model\Session $catalogSession
+     * @param \Magento\Data\Form\FormKey $formKey
      */
     public function __construct(
         \Magento\App\Helper\Context $context,
@@ -112,13 +118,15 @@ class Compare extends \Magento\Core\Helper\Url
         \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility,
         \Magento\Log\Model\Visitor $logVisitor,
         \Magento\Customer\Model\Session $customerSession,
-        \Magento\Catalog\Model\Session $catalogSession
+        \Magento\Catalog\Model\Session $catalogSession,
+        \Magento\Data\Form\FormKey $formKey
     ) {
         $this->_itemCollectionFactory = $itemCollectionFactory;
         $this->_catalogProductVisibility = $catalogProductVisibility;
         $this->_logVisitor = $logVisitor;
         $this->_customerSession = $customerSession;
         $this->_catalogSession = $catalogSession;
+        $this->_formKey = $formKey;
         parent::__construct($context, $storeManager);
     }
 
@@ -152,7 +160,8 @@ class Compare extends \Magento\Core\Helper\Url
     {
         return array(
             'product' => $product->getId(),
-            \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl()
+            \Magento\App\Action\Action::PARAM_NAME_URL_ENCODED => $this->getEncodedUrl(),
+            'form_key' => $this->_formKey->getFormKey(),
         );
     }
 
diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Price.php b/app/code/Magento/Catalog/Model/Layer/Filter/Price.php
index 2a77459993f48e0a31211a144b62044bb2513df2..fb1ff9e0924d839e01e4afb2dc178ff4d7bc3fcd 100644
--- a/app/code/Magento/Catalog/Model/Layer/Filter/Price.php
+++ b/app/code/Magento/Catalog/Model/Layer/Filter/Price.php
@@ -34,9 +34,6 @@
 
 namespace Magento\Catalog\Model\Layer\Filter;
 
-/**
- * @SuppressWarnings(PHPMD.LongVariable)
- */
 class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter
 {
     /**
@@ -79,7 +76,7 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter
      *
      * @var \Magento\Catalog\Model\Layer\Filter\Price\Algorithm
      */
-    protected $_catalogLayerFilterPriceAlgorithm;
+    protected $_priceAlgorithm;
 
     /**
      * Customer session
@@ -94,7 +91,7 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter
      * @param \Magento\Catalog\Model\Layer $catalogLayer
      * @param \Magento\Catalog\Model\Resource\Layer\Filter\PriceFactory $filterPriceFactory
      * @param \Magento\Customer\Model\Session $customerSession
-     * @param \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $catalogLayerFilterPriceAlgorithm
+     * @param \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $priceAlgorithm
      * @param \Magento\Core\Model\Registry $coreRegistry
      * @param array $data
      */
@@ -104,13 +101,13 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter
         \Magento\Catalog\Model\Layer $catalogLayer,
         \Magento\Catalog\Model\Resource\Layer\Filter\PriceFactory $filterPriceFactory,
         \Magento\Customer\Model\Session $customerSession,
-        \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $catalogLayerFilterPriceAlgorithm,
+        \Magento\Catalog\Model\Layer\Filter\Price\Algorithm $priceAlgorithm,
         \Magento\Core\Model\Registry $coreRegistry,
         array $data = array()
     ) {
         $this->_resource = $filterPriceFactory->create();
         $this->_customerSession = $customerSession;
-        $this->_catalogLayerFilterPriceAlgorithm = $catalogLayerFilterPriceAlgorithm;
+        $this->_priceAlgorithm = $priceAlgorithm;
         $this->_coreRegistry = $coreRegistry;
         parent::__construct($filterItemFactory, $storeManager, $catalogLayer, $data);
         $this->_requestVar = 'price';
@@ -289,7 +286,7 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter
         ) {
             return array();
         }
-        $this->_catalogLayerFilterPriceAlgorithm->setPricesModel($this)->setStatistics(
+        $this->_priceAlgorithm->setPricesModel($this)->setStatistics(
             $collection->getMinPrice(),
             $collection->getMaxPrice(),
             $collection->getPriceStandardDeviation(),
@@ -300,11 +297,11 @@ class Price extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter
             if ($appliedInterval[0] == $appliedInterval[1] || $appliedInterval[1] === '0') {
                 return array();
             }
-            $this->_catalogLayerFilterPriceAlgorithm->setLimits($appliedInterval[0], $appliedInterval[1]);
+            $this->_priceAlgorithm->setLimits($appliedInterval[0], $appliedInterval[1]);
         }
 
         $items = array();
-        foreach ($this->_catalogLayerFilterPriceAlgorithm->calculateSeparators() as $separator) {
+        foreach ($this->_priceAlgorithm->calculateSeparators() as $separator) {
             $items[] = array(
                 'label' => $this->_renderRangeLabel($separator['from'], $separator['to']),
                 'value' => (($separator['from'] == 0) ? '' : $separator['from'])
diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media.php b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media.php
index 37aade372f52743eb90ca37bafbd02eb0e28dd11..01a4cb89aba280bc5bc750a4511a6a3cf639f5f9 100644
--- a/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media.php
+++ b/app/code/Magento/Catalog/Model/Product/Attribute/Backend/Media.php
@@ -199,8 +199,6 @@ class Media extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend
             $value['images'] = array();
         }
 
-
-
         $clearImages = array();
         $newImages   = array();
         $existImages = array();
@@ -226,7 +224,8 @@ class Media extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend
                     continue;
                 }
                 $duplicate[$image['value_id']] = $this->_copyImage($image['file']);
-                $newImages[$image['file']] = $duplicate[$image['value_id']];
+                $image['new_file'] = $duplicate[$image['value_id']];
+                $newImages[$image['file']] = $image;
             }
 
             $value['duplicate'] = $duplicate;
diff --git a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php
index e61902ac18c0efe64e0e15f495cddf9b4fa2ef73..1735a8b6a68eaf76c4af81a93aba7650ac72d7e0 100644
--- a/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php
+++ b/app/code/Magento/Catalog/Model/Product/Type/AbstractType.php
@@ -506,7 +506,7 @@ abstract class AbstractType
 
                         try {
                             $this->_filesystem->getDirectoryWrite(\Magento\Filesystem::ROOT)->create($path);
-                        } catch (\Magento\Filesystem\Exception $e) {
+                        } catch (\Magento\Filesystem\FilesystemException $e) {
                             throw new \Magento\Core\Exception(
                                 __("We can't create writeable directory \"%1\".", $path)
                             );
diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php
index 3ebf8306126bd384911b9b3edda0f83b87c695cf..6b3bb79d076cacd1345eeb10c6e6d4984eef6926 100644
--- a/app/code/Magento/Catalog/Model/Resource/Category/Flat.php
+++ b/app/code/Magento/Catalog/Model/Resource/Category/Flat.php
@@ -1321,17 +1321,17 @@ class Flat extends \Magento\Index\Model\Resource\AbstractResource
      */
     public function getParentDesignCategory($category)
     {
-        $adapter    = $this->_getReadAdapter();
-        $levelField = $adapter->quoteIdentifier('level');
-        $pathIds    = array_reverse($category->getPathIds());
-        $select = $adapter->select()
-            ->from(array('main_table' => $this->getMainStoreTable($category->getStoreId())), '*')
-            ->where('entity_id IN (?)', $pathIds)
-            ->where('custom_use_parent_settings = ?', 0)
-            ->where($levelField . ' != ?', 0)
-            ->order('level ' . \Magento\DB\Select::SQL_DESC);
-        $result = $adapter->fetchRow($select);
-        return $this->_categoryFactory->create()->setData($result);
+        $pathIds = array_reverse($category->getPathIds());
+        $collection = clone $category->getCollection();
+        $collection
+            ->setMainTable($this->getMainStoreTable($category->getStoreId()))
+            ->addFieldToSelect('*')
+            ->addFieldToFilter('entity_id', array('in' => $pathIds))
+            ->addFieldToFilter('custom_use_parent_settings', array(array('eq' => 0), array('null' => 0)))
+            ->addFieldToFilter('level', array('neq' => 0))
+            ->setOrder('level', 'DESC')
+            ->load();
+        return $collection->getFirstItem();
     }
 
     /**
diff --git a/app/code/Magento/Catalog/Model/Url.php b/app/code/Magento/Catalog/Model/Url.php
index e6f87519f2d6a6995c69f0562bd539d5b1ab3ac3..34f65d92147d82af2ceaebd281a8c7013e131c95 100644
--- a/app/code/Magento/Catalog/Model/Url.php
+++ b/app/code/Magento/Catalog/Model/Url.php
@@ -1006,7 +1006,7 @@ class Url
      */
     public function generateUniqueIdPath()
     {
-        return str_replace('0.', '', str_replace(' ', '_', microtime()));
+        return str_replace('.', '_', uniqid(mt_rand(), true));
     }
 
     /**
diff --git a/app/code/Magento/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php b/app/code/Magento/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php
index 8e4e1b6a95995dd7145ea85f4db28ee9908da8a7..27c6693a624e37b30027ea1ed09b5fd9f24ad020 100644
--- a/app/code/Magento/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php
+++ b/app/code/Magento/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php
@@ -24,6 +24,9 @@
  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
  */
 
+/** @var $installer \Magento\Catalog\Model\Resource\Setup */
+$installer = $this;
+
 /** @var $this \Magento\Catalog\Model\Resource\Setup */
 $installFile = __DIR__ . '/upgrade-1.6.0.0.8-1.6.0.0.9.php';
 
diff --git a/app/code/Magento/Catalog/view/adminhtml/product/product.css b/app/code/Magento/Catalog/view/adminhtml/product/product.css
index 205199fc30f2a240572898a9fa96ff115a24aac0..78acac6b140ab7135d7505b5efc6a4c04b45a07d 100644
--- a/app/code/Magento/Catalog/view/adminhtml/product/product.css
+++ b/app/code/Magento/Catalog/view/adminhtml/product/product.css
@@ -484,14 +484,16 @@
 .field-price .control,
 .field-special_price .control,
 .field-msrp .control,
-.field-weight .control {
+.field-weight .control,
+.field-quantity_and_stock_status .control {
     position: relative;
 }
 
 .field-price label.mage-error,
 .field-special_price label.mage-error,
 .field-msrp label.mage-error,
-.field-weight label.mage-error {
+.field-weight label.mage-error,
+.field-quantity_and_stock_status label.mage-error {
     position: absolute;
     left: 0;
     top: 30px;
diff --git a/app/code/Magento/Catalog/view/frontend/product/compare/link.phtml b/app/code/Magento/Catalog/view/frontend/product/compare/link.phtml
index b7c2bed52316ae27d7e396bfc375a8df58e94035..ab3f9371ecd90680384abb625ad4a08916ba90f7 100644
--- a/app/code/Magento/Catalog/view/frontend/product/compare/link.phtml
+++ b/app/code/Magento/Catalog/view/frontend/product/compare/link.phtml
@@ -26,13 +26,13 @@
 <?php
 $_helper = $this->helper('Magento\Catalog\Helper\Product\Compare');
 $_items = $_helper->getItemCount() > 0 ? $_helper->getItemCollection() : null;
+$count = $_helper->getItemCount();
 ?>
-<?php if($_helper->getItemCount() > 0): ?>
+<?php if($count > 0): ?>
     <li class="item link compare">
         <a class="action compare" href="<?php echo $_helper->getListUrl() ?>" title="<?php echo __('Compare Products') ?>">
-            <span>
-                <?php echo __('Compare Products') ?><span class="qty"><?php echo __('%1', $_helper->getItemCount()) ?></span>
-            </span>
+            <?php echo __('Compare Products') ?>
+            <span class="counter qty"><?php echo ($count == 1) ? __('1 item') : __('%1 items',$count) ?></span>
         </a>
     </li>
 <?php endif; ?>
diff --git a/app/code/Magento/Catalog/view/frontend/product/compare/sidebar.phtml b/app/code/Magento/Catalog/view/frontend/product/compare/sidebar.phtml
index bc3729367539c38fb728356b980b1ad6d78997e2..49de51cf5362ca85a2a84d9dd852f9edd7ecdfbe 100644
--- a/app/code/Magento/Catalog/view/frontend/product/compare/sidebar.phtml
+++ b/app/code/Magento/Catalog/view/frontend/product/compare/sidebar.phtml
@@ -26,13 +26,14 @@
 <?php
 $_helper = $this->helper('Magento\Catalog\Helper\Product\Compare');
 $_items = $_helper->getItemCount() > 0 ? $_helper->getItemCollection() : null;
+$count = $_helper->getItemCount();
 ?>
 <div class="block compare">
     <div class="title">
         <strong>
             <span class="text"><?php echo __('Compare Products') ?></span>
-            <?php if($_helper->getItemCount() > 0): ?>
-                <span class="qty"><?php echo __('%1', $_helper->getItemCount()) ?></span>
+            <?php if($count > 0): ?>
+                <span class="counter qty"><?php echo ($count == 1) ? __('1 item') : __('%1 items',$count) ?></span>
             <?php endif; ?>
         </strong>
     </div>
diff --git a/app/code/Magento/Catalog/view/frontend/product/view/addtocart.phtml b/app/code/Magento/Catalog/view/frontend/product/view/addtocart.phtml
index 8491717db945022f1daecd71ea7822b77f08465f..e48841a9e4fa340e8d9490c9f8b3bc00f1f3e5d0 100644
--- a/app/code/Magento/Catalog/view/frontend/product/view/addtocart.phtml
+++ b/app/code/Magento/Catalog/view/frontend/product/view/addtocart.phtml
@@ -30,7 +30,7 @@
     <div class="field qty">
         <label class="label" for="qty"><span><?php echo __('Qty') ?></span></label>
         <div class="control">
-            <input type="text"
+            <input type="number"
                    name="qty"
                    id="qty"
                    maxlength="12"
diff --git a/app/code/Magento/Catalog/view/frontend/product/view/type/grouped.phtml b/app/code/Magento/Catalog/view/frontend/product/view/type/grouped.phtml
index c8eb7a5bef241436a4e0a34f56a693209dd95d57..89e0949d6a3f47dfdc4529c6cefc2a6523a40630 100644
--- a/app/code/Magento/Catalog/view/frontend/product/view/type/grouped.phtml
+++ b/app/code/Magento/Catalog/view/frontend/product/view/type/grouped.phtml
@@ -75,7 +75,7 @@
             <td class="col qty">
             <?php if ($_item->isSaleable()) : ?>
                 <div class="control qty">
-                    <input type="text" name="super_group[<?php echo $_item->getId() ?>]"
+                    <input type="number" name="super_group[<?php echo $_item->getId() ?>]"
                            maxlength="12"
                            value="<?php echo $_item->getQty() * 1 ?>"
                            title="<?php echo __('Qty') ?>"
diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php
index e98e60c5b0175357599ca7457dc63d4e46b5a1a6..8b2e34dbec8f9cf2011a949a76e245f16c7a65f0 100644
--- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php
+++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext.php
@@ -391,7 +391,7 @@ class Fulltext extends \Magento\Core\Model\Resource\Db\AbstractDb
         if ($storeId === null && $productIds === null) {
             // Keeping public interface
             $adapter->update($this->getTable('catalogsearch_query'), array('is_processed' => 0));
-            $adapter->truncateTable($this->getTable('catalogsearch_result'));
+            $adapter->delete($this->getTable('catalogsearch_result'));
             $this->_eventManager->dispatch('catalogsearch_reset_search_result');
         } else {
             // Optimized deletion only product-related records
diff --git a/app/code/Magento/CatalogSearch/view/frontend/advanced/result.phtml b/app/code/Magento/CatalogSearch/view/frontend/advanced/result.phtml
index 3938edb1e6df8dc4dc41d3be05253ebaeca88e73..35fa8b7e7ca1cbed6a63f552bc142e572eb4b4f4 100644
--- a/app/code/Magento/CatalogSearch/view/frontend/advanced/result.phtml
+++ b/app/code/Magento/CatalogSearch/view/frontend/advanced/result.phtml
@@ -22,9 +22,13 @@
  * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
  */
 ?>
-<?php if($this->getResultCount()): ?>
+<?php if($results = $this->getResultCount()): ?>
     <div class="search found">
-        <?php echo __('<strong>%1 item(s)</strong> were found using the following search criteria', $this->getResultCount()); ?>
+        <?php if ($results == 1) : ?>
+            <?php echo __('<strong>%1 item</strong> were found using the following search criteria', $results); ?>
+        <?php else: ?>
+            <?php echo __('<strong>%1 items</strong> were found using the following search criteria', $results); ?>
+        <?php endif; ?>
     </div>
 <?php else: ?>
     <div class="message error">
diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml
index 6845a1111a9e8919eb09d2b55898965db1a9298f..3e0375e6eac3bb46f80d658de92a16b57c76a244 100644
--- a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml
+++ b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml
@@ -34,7 +34,7 @@
                 <argument name="path" xsi:type="string">catalogsearch/term/popular</argument>
             </arguments>
         </block>
-        <block class="Magento\View\Element\Html\Link\Current" ifconfig="catalog/seo/search_terms" name="catalog-search-advanced-link">
+        <block class="Magento\View\Element\Html\Link\Current" name="catalog-search-advanced-link">
             <arguments>
                 <argument name="label" xsi:type="string">Advanced Search</argument>
                 <argument name="path" xsi:type="string">catalogsearch/advanced</argument>
diff --git a/app/code/Magento/Centinel/Model/Service.php b/app/code/Magento/Centinel/Model/Service.php
index 16325bc0684c75713dce53972edd83941e566453..f73402df1e9aa1b8e183a3695170da82d29a595d 100644
--- a/app/code/Magento/Centinel/Model/Service.php
+++ b/app/code/Magento/Centinel/Model/Service.php
@@ -55,18 +55,11 @@ class Service extends \Magento\Object
     );
 
     /**
-     * Is API model configured
-     *
-     * @var bool
-     */
-    protected $_isConfigured = false;
-
-    /**
-     * Validation api model
+     * Validation api model factory
      *
      * @var \Magento\Centinel\Model\Api
      */
-    protected $_api;
+    protected $_apiFactory;
 
     /**
      * Config
@@ -115,7 +108,7 @@ class Service extends \Magento\Object
     
     /**
      * @param \Magento\Centinel\Model\Config $config
-     * @param \Magento\Centinel\Model\Api $api
+     * @param \Magento\Centinel\Model\ApiFactory $apiFactory
      * @param \Magento\UrlInterface $url
      * @param \Magento\Session\SessionManagerInterface $centinelSession
      * @param \Magento\Centinel\Model\StateFactory $stateFactory
@@ -125,7 +118,7 @@ class Service extends \Magento\Object
      */
     public function __construct(
         \Magento\Centinel\Model\Config $config,
-        \Magento\Centinel\Model\Api $api,
+        \Magento\Centinel\Model\ApiFactory $apiFactory,
         \Magento\UrlInterface $url,
         \Magento\Session\SessionManagerInterface $centinelSession,
         \Magento\Centinel\Model\StateFactory $stateFactory,
@@ -134,7 +127,7 @@ class Service extends \Magento\Object
         array $data = array()
     ) {
         $this->_config = $config;
-        $this->_api = $api;
+        $this->_apiFactory = $apiFactory;
         $this->_url = $url;
         $this->_centinelSession = $centinelSession;
         $this->_stateFactory = $stateFactory;
@@ -195,20 +188,16 @@ class Service extends \Magento\Object
      */
     protected function _getApi()
     {
-        if ($this->_isConfigured) {
-            return $this->_api;
-        }
-
         $config = $this->_getConfig();
-        $this->_api
+        $api = $this->_apiFactory->create();
+        $api
            ->setProcessorId($config->getProcessorId())
            ->setMerchantId($config->getMerchantId())
            ->setTransactionPwd($config->getTransactionPwd())
            ->setIsTestMode($config->getIsTestMode())
            ->setDebugFlag($config->getDebugFlag())
            ->setApiEndpointUrl($this->getCustomApiEndpointUrl());
-        $this->_isConfigured = true;
-        return $this->_api;
+        return $api;
     }
 
     /**
@@ -361,7 +350,6 @@ class Service extends \Magento\Object
     public function reset()
     {
         $this->_resetValidationState();
-        $this->_api = null;
         return $this;
     }
 
diff --git a/app/code/Magento/Centinel/view/frontend/authentication.phtml b/app/code/Magento/Centinel/view/frontend/authentication.phtml
index 43ce26d12e956efa3b8c127735b92b39aef9ad58..68ea70519038ceeab742e5bbcbab4bb8f83e2cd3 100644
--- a/app/code/Magento/Centinel/view/frontend/authentication.phtml
+++ b/app/code/Magento/Centinel/view/frontend/authentication.phtml
@@ -29,7 +29,7 @@
         <h3><?php echo __('Card Verification')?></h3>
         <p><?php echo __('Please verify the card with the issuer bank:') ?></p>
         <div class="authentication">
-            <iframe id="centinel-authenticate-iframe" frameborder="0" border="0" src="" data-container="iframe"></iframe>
+            <iframe id="centinel-authenticate-iframe" frameborder="0" border="0" src="" data-container="iframe" width="100%" height="400" title="<?php echo __('Card Verification')?>"></iframe>
         </div>
     </div>
 <?php else:?>
diff --git a/app/code/Magento/Checkout/Block/Cart/Link.php b/app/code/Magento/Checkout/Block/Cart/Link.php
index e8dfbcdefe981dbe732f0f471f3667f19214da5d..41e001f12a8ef05079b3f14bb887ac3b69243e4b 100644
--- a/app/code/Magento/Checkout/Block/Cart/Link.php
+++ b/app/code/Magento/Checkout/Block/Cart/Link.php
@@ -105,7 +105,7 @@ class Link extends \Magento\View\Element\Html\Link
     protected function _createLabel($count)
     {
         if ($count == 1) {
-            return __('My Cart (%1 item)', $count);
+            return __('My Cart (1 item)');
         } elseif ($count > 0) {
             return __('My Cart (%1 items)', $count);
         } else {
diff --git a/app/code/Magento/Checkout/Block/Onepage/Payment.php b/app/code/Magento/Checkout/Block/Onepage/Payment.php
index 9b610571400d8a254ee7b8fa5b870aabc5ad6598..6c49c96fe5679ea42ddbf226758b219ee106231f 100644
--- a/app/code/Magento/Checkout/Block/Onepage/Payment.php
+++ b/app/code/Magento/Checkout/Block/Onepage/Payment.php
@@ -54,4 +54,14 @@ class Payment extends \Magento\Checkout\Block\Onepage\AbstractOnepage
     {
         return (float)$this->getQuote()->getBaseGrandTotal();
     }
+
+    /**
+     * Check whether the quote has recurring items
+     *
+     * @return bool
+     */
+    public function hasRecurringItems()
+    {
+       return $this->getQuote()->hasRecurringItems();
+    }
 }
diff --git a/app/code/Magento/Checkout/Block/Onepage/Success.php b/app/code/Magento/Checkout/Block/Onepage/Success.php
index c8139e46cc1cbcca9c99b837f23bbd6fee40f74b..10c00be0c730775e360562785512ad09b9143030 100644
--- a/app/code/Magento/Checkout/Block/Onepage/Success.php
+++ b/app/code/Magento/Checkout/Block/Onepage/Success.php
@@ -56,7 +56,7 @@ class Success extends \Magento\View\Element\Template
     protected $_agreementFactory;
 
     /**
-     * @var \Magento\Sales\Model\Resource\Recurring\Profile\Collection
+     * @var \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory
      */
     protected $_recurringProfileCollectionFactory;
 
diff --git a/app/code/Magento/Checkout/Controller/Cart.php b/app/code/Magento/Checkout/Controller/Cart.php
index b20c725d99ccbcdc734d5184ddd2cbcfee4a54f4..bbef85ec7621191f9aa966e5c3db19ff4f9e641b 100644
--- a/app/code/Magento/Checkout/Controller/Cart.php
+++ b/app/code/Magento/Checkout/Controller/Cart.php
@@ -49,22 +49,25 @@ class Cart
     protected $_storeManager;
 
     /**
-     * @var \Magento\Message\ManagerInterface
+     * @var \Magento\Core\App\Action\FormKeyValidator
      */
-    protected $messageManager;
+    protected $_formKeyValidator;
 
     /**
      * @param \Magento\App\Action\Context $context
      * @param \Magento\Core\Model\Store\ConfigInterface $storeConfig
      * @param \Magento\Checkout\Model\Session $checkoutSession
      * @param \Magento\Core\Model\StoreManagerInterface $storeManager
+     * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
      */
     public function __construct(
         \Magento\App\Action\Context $context,
         \Magento\Core\Model\Store\ConfigInterface $storeConfig,
         \Magento\Checkout\Model\Session $checkoutSession,
-        \Magento\Core\Model\StoreManagerInterface $storeManager
+        \Magento\Core\Model\StoreManagerInterface $storeManager,
+        \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
     ) {
+        $this->_formKeyValidator = $formKeyValidator;
         $this->_storeConfig = $storeConfig;
         $this->_checkoutSession = $checkoutSession;
         $this->_storeManager = $storeManager;
@@ -418,6 +421,11 @@ class Cart
      */
     public function updatePostAction()
     {
+        if (!$this->_formKeyValidator->validate($this->getRequest())) {
+            $this->_redirect('*/*/');
+            return;
+        }
+
         $updateAction = (string)$this->getRequest()->getParam('update_cart_action');
 
         switch ($updateAction) {
diff --git a/app/code/Magento/Checkout/Helper/Data.php b/app/code/Magento/Checkout/Helper/Data.php
index 531760bba5ff2f142d6ad10a66ba03c4ed566c6f..9ed30be18213c6151c309ba55344431f9acbc38a 100644
--- a/app/code/Magento/Checkout/Helper/Data.php
+++ b/app/code/Magento/Checkout/Helper/Data.php
@@ -208,7 +208,6 @@ class Data extends \Magento\App\Helper\AbstractHelper
      */
     public function sendPaymentFailedEmail($checkout, $message, $checkoutType = 'onepage')
     {
-        /* @var $translate \Magento\Core\Model\Translate */
         $this->_translator->setTranslateInline(false);
 
         /** @var \Magento\Email\Model\Template $mailTemplate */
diff --git a/app/code/Magento/Checkout/view/frontend/cart/form.phtml b/app/code/Magento/Checkout/view/frontend/cart/form.phtml
index e139a2d49049ed7bf58634d63d04b2c5eae4ed5c..bf96b44470c861c316ee46837363020f3f548dca 100644
--- a/app/code/Magento/Checkout/view/frontend/cart/form.phtml
+++ b/app/code/Magento/Checkout/view/frontend/cart/form.phtml
@@ -28,6 +28,7 @@
 <div class="cart table wrapper<?php echo $mergedCells == 2 ? ' detailed' : ''; ?>">
     <?php echo $this->getChildHtml('form_before') ?>
     <form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post" id="form-validate" >
+        <?php echo $this->getBlockHtml('formkey'); ?>
         <table id="shopping-cart-table" class="cart items data">
             <thead>
                 <tr>
diff --git a/app/code/Magento/Checkout/view/frontend/cart/item/configure/updatecart.phtml b/app/code/Magento/Checkout/view/frontend/cart/item/configure/updatecart.phtml
index 1c13b896e1479756f4b815c43e97b09a79eee140..71990e390b553f17a6f99706405c32f8455cfa06 100644
--- a/app/code/Magento/Checkout/view/frontend/cart/item/configure/updatecart.phtml
+++ b/app/code/Magento/Checkout/view/frontend/cart/item/configure/updatecart.phtml
@@ -31,7 +31,7 @@
         <div class="field qty">
             <label class="label" for="qty"><span><?php echo __('Qty') ?></span></label>
             <div class="control">
-                <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo __('Qty') ?>" class="input-text qty" data-validate="{required:true,digits:true}"/>
+                <input type="number" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo __('Qty') ?>" class="input-text qty" data-validate="{required:true,digits:true}"/>
             </div>
         </div>
         <?php endif; ?>
diff --git a/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml b/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml
index faf4f01808d9eb8f263d74ed7f9d79faa5f945b5..03148346a552bf179a4106be13f686d3521bce3c 100644
--- a/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml
+++ b/app/code/Magento/Checkout/view/frontend/cart/item/default.phtml
@@ -190,7 +190,7 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite
     <?php endif; ?>
     <td class="col qty">
         <div class="control qty">
-        <input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" type="text" size="4" title="<?php echo __('Qty') ?>" class="input-text qty" maxlength="12" data-validate="{required:true,'validate-greater-than-zero':true}"/>
+        <input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" type="number" size="4" title="<?php echo __('Qty') ?>" class="input-text qty" maxlength="12" data-validate="{required:true,'validate-greater-than-zero':true}"/>
         </div>
         <?php $cols++; ?>
     </td>
diff --git a/app/code/Magento/Checkout/view/frontend/cart/minicart.phtml b/app/code/Magento/Checkout/view/frontend/cart/minicart.phtml
index 6bcc918c8b41bcc758031d60f4faa620f74074a2..2968b6bd19f485b91d7b0811832a93b819ad95e2 100644
--- a/app/code/Magento/Checkout/view/frontend/cart/minicart.phtml
+++ b/app/code/Magento/Checkout/view/frontend/cart/minicart.phtml
@@ -34,9 +34,7 @@
 <?php if (!$this->getIsLinkMode() || !$this->getIsNeedToDisplaySideBar()): ?>
     <a data-toggle="dropdown" class="action showcart" href="<?php echo $this->getUrl('checkout/cart'); ?>">
         <span class="text"><?php echo __('My Cart'); ?></span>
-        <span class="qty<?php echo ($_cartQty > 0) ? '' : ' empty'; ?>">
-            <?php echo $_cartQty ?>
-        </span>
+        <span class="counter qty<?php echo ($_cartQty > 0) ? '' : ' empty'; ?>"><?php echo ($_cartQty == 1) ? __('1 item') : __('%1 items',$_cartQty) ?></span>
     </a>
     <div data-target="dropdown" class="block minicart<?php echo ($_cartQty > 0) ? '' : ' empty'; ?>">
         <button title="<?php echo __('Close'); ?>" type="button" class="action close" data-toggle="dropdown">
diff --git a/app/code/Magento/Checkout/view/frontend/js/opcheckout.js b/app/code/Magento/Checkout/view/frontend/js/opcheckout.js
index 501ef6b3c056ef01e4c9971d99e8502cbd4175f0..2166e022b203f48de1ffcea0d44e4f8c37ce7bf1 100644
--- a/app/code/Magento/Checkout/view/frontend/js/opcheckout.js
+++ b/app/code/Magento/Checkout/view/frontend/js/opcheckout.js
@@ -406,7 +406,7 @@
                 if ($.isNumeric(checkoutPrice)) {
                     this.checkoutPrice = checkoutPrice;
                 }
-                if (this.checkoutPrice < this.options.minBalance) {
+                if (this.checkoutPrice < this.options.minBalance && !this.options.hasRecurringItems) {
                     this._disablePaymentMethods();
                 } else {
                     this._enablePaymentMethods();
@@ -422,7 +422,7 @@
                     if (data.totalPrice) {
                         data.totalPrice = this.checkoutPrice;
                     }
-                    if (this.checkoutPrice < this.options.minBalance) {
+                    if (this.checkoutPrice < this.options.minBalance && !this.options.hasRecurringItems) {
                         // Add free input field, hide and disable unchecked checkbox payment method and all radio button payment methods
                         this._disablePaymentMethods();
                     } else {
@@ -470,7 +470,7 @@
                 alert($.mage.__("We can't complete your order because you don't have a payment method available."));
                 return false;
             }
-            if (this.checkoutPrice < this.options.minBalance) {
+            if (this.checkoutPrice < this.options.minBalance && !this.options.hasRecurringItems) {
                 return true;
             } else if (methods.filter('input:radio:checked').length) {
                 return true;
diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping.xml
index 6992a9165dc27dc8a182b4adb75c970e33642878..47343cd2918792254a9bc517de9e2fafe713236d 100644
--- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping.xml
+++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping.xml
@@ -24,12 +24,8 @@
  */
 -->
 <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" label="Multishipping Checkout" design_abstraction="custom">
-    <referenceBlock name="root">
-        <action method="setTemplate">
-            <argument name="template" xsi:type="string">1column.phtml</argument>
-        </action>
-    </referenceBlock>
-    <referenceContainer name="content">
+    <update handle="page_two_columns_left"/>
+    <referenceContainer name="left">
         <block class="Magento\Checkout\Block\Multishipping\State" name="checkout_state" template="multishipping/state.phtml"/>
     </referenceContainer>
 </layout>
diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml
index 79ceb873ba908e8f7daa5a4803b3cc21a360b646..871ce71e3d5e4954aa2b303ff7246f266fac3a73 100644
--- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml
+++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml
@@ -24,8 +24,8 @@
  */
 -->
 <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-    <update handle="page_one_column"/>
-    <referenceContainer name="content">
+    <update handle="page_two_columns_left"/>
+    <referenceContainer name="left">
         <container name="checkout.progress.wrapper" label="Checkout Progress Wrapper" htmlTag="div" htmlId="checkout-progress-wrapper">
             <block class="Magento\Checkout\Block\Onepage\Progress" name="checkout.progress" before="-" template="onepage/progress.phtml"/>
         </container>
diff --git a/app/code/Magento/Checkout/view/frontend/multishipping/addresses.phtml b/app/code/Magento/Checkout/view/frontend/multishipping/addresses.phtml
index e91a5f250f130e755173fee623aaea17f18f469b..a8af26274308c6502d0cf2c81f28a240a5dff7ba 100644
--- a/app/code/Magento/Checkout/view/frontend/multishipping/addresses.phtml
+++ b/app/code/Magento/Checkout/view/frontend/multishipping/addresses.phtml
@@ -52,7 +52,7 @@
                     <td class="col product"><?php echo $this->getItemHtml($_item->getQuoteItem()) ?></td>
                     <td class="col qty">
                         <div class="control qty">
-                            <input type="text" name="ship[<?php echo $_index ?>][<?php echo $_item->getQuoteItemId() ?>][qty]" value="<?php echo $this->escapeHtml($_item->getQty()) ?>" size="2" class="input-text qty" data-validate="{number: true}"/>
+                            <input type="number" name="ship[<?php echo $_index ?>][<?php echo $_item->getQuoteItemId() ?>][qty]" value="<?php echo $this->escapeHtml($_item->getQty()) ?>" size="2" class="input-text qty" data-validate="{number: true}"/>
                         </div>
                     </td>
                     <td class="col address">
diff --git a/app/code/Magento/Checkout/view/frontend/onepage.phtml b/app/code/Magento/Checkout/view/frontend/onepage.phtml
index de732fa6c424d747768b7b27bd906395ad0db6fd..c10848732f96c1fd72bd6d89bdfc043317ea3ada 100644
--- a/app/code/Magento/Checkout/view/frontend/onepage.phtml
+++ b/app/code/Magento/Checkout/view/frontend/onepage.phtml
@@ -24,6 +24,7 @@
  */
 ?>
 <?php
+/** @var \Magento\Checkout\Block\Onepage\Payment $_paymentBlock */
 $_paymentBlock = $this->getLayout()->getBlock('checkout.onepage.payment');
 $_registerParam = $this->getRequest()->getParam('register');
 ?>
@@ -58,6 +59,7 @@ $_registerParam = $this->getRequest()->getParam('register');
                         })
                         .opcheckout({
                             quoteBaseGrandTotal: <?php echo (float)$_paymentBlock->getQuoteBaseGrandTotal() ?>,
+                            hasRecurringItems: <?php echo $_paymentBlock->hasRecurringItems() ? 'true' : 'false' ?>,
                             progressUrl: '<?php echo $this->getUrl('checkout/onepage/progress') ?>',
                             reviewUrl: '<?php echo $this->getUrl('checkout/onepage/review') ?>',
                             failureUrl: '<?php echo $this->getUrl('checkout/cart') ?>',
diff --git a/app/code/Magento/Checkout/view/frontend/onepage/login.phtml b/app/code/Magento/Checkout/view/frontend/onepage/login.phtml
index 459243004aaedefe8cc5cdd9b4b6e5435865a41b..ca560a15ffd755bf3d26fabdcc93e890ee570c69 100644
--- a/app/code/Magento/Checkout/view/frontend/onepage/login.phtml
+++ b/app/code/Magento/Checkout/view/frontend/onepage/login.phtml
@@ -36,6 +36,7 @@
     <div class="title"><strong><?php echo __('Login') ?></strong></div>
     <div class="content">
         <form class="form login" id="login-form" action="<?php echo $this->getPostAction() ?>" method="post">
+            <?php echo $this->getBlockHtml('formkey'); ?>
             <fieldset class="fieldset login" data-hasrequired="<?php echo __('* Required Fields') ?>">
                 <p class="field note"><?php echo __('Already registered?') ?> <?php echo __('Please log in below:') ?></p>
                 <div class="field email required">
diff --git a/app/code/Magento/Connect/view/adminhtml/extension/custom/authors.phtml b/app/code/Magento/Connect/view/adminhtml/extension/custom/authors.phtml
index 8c29e53017b2cbb79c112fe0693db9c7517b950f..a73f35d9f61bb944b2bbe9d3e7bcf31b4db7add7 100644
--- a/app/code/Magento/Connect/view/adminhtml/extension/custom/authors.phtml
+++ b/app/code/Magento/Connect/view/adminhtml/extension/custom/authors.phtml
@@ -28,13 +28,13 @@
 var id = 0;
 var authorTemplate =
     '<tr>'+
-        '<td>'+
+        '<td class="col-name">'+
             '<input type="text" class="input-text required-entry" name="authors[name][]" id="authors_name_{{id}}" value="{{name}}"/>'+
         '</td>'+
-        '<td>'+
+        '<td class="col-user">'+
             '<input type="text" class="input-text required-entry" name="authors[user][]" id="authors_user_{{id}}" value="{{user}}"/>'+
         '</td>'+
-        '<td>'+
+        '<td class="col-email">'+
             '<input type="text" class="input-text required-entry validate-email" name="authors[email][]" id="authors_email_{{id}}" value="{{email}}"/>'+
         '</td>'+
         '<td class="col-delete">'+
@@ -62,12 +62,17 @@ function addAuthor(data)
         <table class="data-table" cellspacing="0">
             <thead>
                 <tr>
-                    <th><?php echo __("Name") ?><span class="required">*</span></th>
-                    <th><?php echo __("User") ?><span class="required">*</span></th>
-                    <th><?php echo __("Email") ?><span class="required">*</span></th>
-                    <th class="col-delete"><?php echo __("Remove") ?><span class="required">*</span></th>
+                    <th class="col-name required"><?php echo __("Name") ?></th>
+                    <th class="col-user required"><?php echo __("User") ?></th>
+                    <th class="col-email required"><?php echo __("Email") ?></th>
+                    <th class="col-delete"><?php echo __("Remove") ?></th>
                 </tr>
             </thead>
+            <tfoot>
+            <tr>
+                <td colspan="4"><?php echo $this->getAddAuthorButtonHtml() ?></td>
+            </tr>
+            </tfoot>
             <tbody id="authors_container">
                 <script type="text/javascript">
                 <?php if (count($this->getAuthors())): ?>
@@ -79,11 +84,6 @@ function addAuthor(data)
                 <?php endif;?>
                 </script>
             </tbody>
-            <tfoot>
-                <tr>
-                    <td colspan="4"><?php echo $this->getAddAuthorButtonHtml() ?></td>
-                </tr>
-            </tfoot>
         </table>
     </div>
 </fieldset>
diff --git a/app/code/Magento/Core/App/Action/Plugin/Session.php b/app/code/Magento/Core/App/Action/Plugin/Session.php
index 1801244c661f0f058a9804676c1530ee2ed806ef..31d756af8be1317458c45f092c453d3e6bf9d18f 100644
--- a/app/code/Magento/Core/App/Action/Plugin/Session.php
+++ b/app/code/Magento/Core/App/Action/Plugin/Session.php
@@ -147,7 +147,7 @@ class Session
      */
     protected function _forward(\Magento\App\RequestInterface $request)
     {
-        $request->initForwared();
+        $request->initForward();
         $request->setActionName('noCookies');
         $request->setControllerName('index');
         $request->setModuleName('core');
diff --git a/app/code/Magento/Core/Model/App.php b/app/code/Magento/Core/Model/App.php
index 4c45870ff7bfd1233961fdd28167d3b255550c0b..9daf1c3ef3fbde36d2585c9cb9d87213e3f4a08e 100644
--- a/app/code/Magento/Core/Model/App.php
+++ b/app/code/Magento/Core/Model/App.php
@@ -53,7 +53,7 @@ class App implements \Magento\Core\Model\AppInterface
     /**
      * Magento version
      */
-    const VERSION = '2.0.0.0-dev57';
+    const VERSION = '2.0.0.0-dev58';
 
 
     /**
@@ -804,7 +804,7 @@ class App implements \Magento\Core\Model\AppInterface
             'revision'  => '0',
             'patch'     => '0',
             'stability' => 'dev',
-            'number'    => '57',
+            'number'    => '58',
         );
     }
 }
diff --git a/app/code/Magento/Core/Model/Config/FileResolver.php b/app/code/Magento/Core/Model/Config/FileResolver.php
index ea38c20537bf6c8bbe8488cf886f74b7dbc346e8..c553153c886b6d1ebca2e880f48c9f14927575fd 100644
--- a/app/code/Magento/Core/Model/Config/FileResolver.php
+++ b/app/code/Magento/Core/Model/Config/FileResolver.php
@@ -64,7 +64,7 @@ class FileResolver implements \Magento\Config\FileResolverInterface
                 $directory = $this->filesystem->getDirectoryRead(\Magento\Filesystem::CONFIG);
                 $iterator = $this->iteratorFactory->create(
                     $directory,
-                    $directory->search('#' . preg_quote($filename) . '$#')
+                    $directory->search('{' . $filename . ',*/' . $filename . '}')
                 );
                 break;
             case 'global':
diff --git a/app/code/Magento/Core/Model/Design.php b/app/code/Magento/Core/Model/Design.php
index e9c9032cbf149db67b4edf9bb91565190c6c4d80..32931ba20dee34b495889da002aac1fce5f292aa 100644
--- a/app/code/Magento/Core/Model/Design.php
+++ b/app/code/Magento/Core/Model/Design.php
@@ -74,11 +74,11 @@ class Design extends \Magento\Core\Model\AbstractModel
     protected $_dateTime;
 
     /**
-     * @param \Magento\Core\Model\Context $context
-     * @param \Magento\Core\Model\Registry $registry
-     * @param \Magento\Core\Model\LocaleInterface $locale
+     * @param Context $context
+     * @param Registry $registry
+     * @param LocaleInterface $locale
      * @param \Magento\Stdlib\DateTime $dateTime
-     * @param \Magento\Core\Model\Resource\AbstractResource $resource
+     * @param Resource\AbstractResource $resource
      * @param \Magento\Data\Collection\Db $resourceCollection
      * @param array $data
      */
@@ -91,9 +91,9 @@ class Design extends \Magento\Core\Model\AbstractModel
         \Magento\Data\Collection\Db $resourceCollection = null,
         array $data = array()
     ) {
-        parent::__construct($context, $registry, $resource, $resourceCollection, $data);
         $this->_locale = $locale;
         $this->_dateTime = $dateTime;
+        parent::__construct($context, $registry, $resource, $resourceCollection, $data);
     }
 
     /**
diff --git a/app/code/Magento/Core/Model/File/Storage.php b/app/code/Magento/Core/Model/File/Storage.php
index 3ae3e1f056f1897f546ee2f9dccd99fa84490a7f..6dc62095d782a4df602035a322343461e9467a28 100644
--- a/app/code/Magento/Core/Model/File/Storage.php
+++ b/app/code/Magento/Core/Model/File/Storage.php
@@ -242,7 +242,7 @@ class Storage extends \Magento\Core\Model\AbstractModel
                 'source'                        => $sourceModel->getStorageName(),
                 'destination'                   => $destinationModel->getStorageName(),
                 'destination_storage_type'      => $storageDest,
-                'destination_connection_name'   => (string) $destinationModel->getConfigConnectionName(),
+                'destination_connection_name'   => (string) $destinationModel->getConnectionName(),
                 'has_errors'                    => false,
                 'timeout_reached'               => false
             );
diff --git a/app/code/Magento/Core/Model/Layout.php b/app/code/Magento/Core/Model/Layout.php
index d32868c3745ca029be258f6d6e4436e29090f31f..990b6bb55bd156e591dd5b9fc9b1004a8aa4b8f8 100644
--- a/app/code/Magento/Core/Model/Layout.php
+++ b/app/code/Magento/Core/Model/Layout.php
@@ -762,7 +762,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn
                 $this->_structure->setAsChild($name, $parentName, $alias);
             } else {
                 $this->_logger
-                    ->log("Broken reference: the '{$name}' element cannot be added as child to '{$parentName}, "
+                    ->log("Broken reference: the '{$name}' element cannot be added as child to '{$parentName}', "
                         . 'because the latter doesn\'t exist', \Zend_Log::CRIT
                     );
             }
diff --git a/app/code/Magento/Core/Model/Locale/Hierarchy/Config/FileResolver.php b/app/code/Magento/Core/Model/Locale/Hierarchy/Config/FileResolver.php
index 6ea0555b87fb4e4ca99c52a7132e7b4e0c8798f2..0101581cff634c9f8a9177e8aed8192a238c8df6 100644
--- a/app/code/Magento/Core/Model/Locale/Hierarchy/Config/FileResolver.php
+++ b/app/code/Magento/Core/Model/Locale/Hierarchy/Config/FileResolver.php
@@ -58,7 +58,7 @@ class FileResolver implements \Magento\Config\FileResolverInterface
         if ($this->directoryRead->isExist('locale')) {
             $result = $this->iteratorFactory->create(
                 $this->directoryRead,
-                $this->directoryRead->search('#' . preg_quote($filename) . '$#', 'locale')
+                $this->directoryRead->search('/locale/*/' . $filename)
             );
         }
         return $result;
diff --git a/app/code/Magento/Core/Model/Resource/File/Storage/File.php b/app/code/Magento/Core/Model/Resource/File/Storage/File.php
index 1f2963a003d9a46faf39686316c7e68bb0d3c045..269430467e5d75d4071592c297c6756117d44e51 100644
--- a/app/code/Magento/Core/Model/Resource/File/Storage/File.php
+++ b/app/code/Magento/Core/Model/Resource/File/Storage/File.php
@@ -75,7 +75,7 @@ class File
                 if ($directoryInstance->isDirectory($path)) {
                     $directories[] = array(
                         'name' => $itemName,
-                        'path' => dirname($path)
+                        'path' => (dirname($path) == '.') ? '/' : dirname($path)
                     );
                 } else {
                     $files[] = $path;
diff --git a/app/code/Magento/Core/Model/Resource/Setup.php b/app/code/Magento/Core/Model/Resource/Setup.php
index 4abe5dfd0cea5afe00d6c572a80cf584d26e3022..ad9c06aa49c3991302064e963ddb7aa287b4a34e 100644
--- a/app/code/Magento/Core/Model/Resource/Setup.php
+++ b/app/code/Magento/Core/Model/Resource/Setup.php
@@ -483,7 +483,7 @@ class Setup implements \Magento\Module\Updater\SetupInterface
             try {
                 switch ($fileType) {
                     case 'php':
-                        $result = include $fileName;
+                        $result = $this->_includeFile($fileName);
                         break;
                     case 'sql':
                         $sql = $this->modulesDir->readFile($this->modulesDir->getRelativePath($fileName));
@@ -514,6 +514,20 @@ class Setup implements \Magento\Module\Updater\SetupInterface
         return $version;
     }
 
+    /**
+     * Include file by path
+     * This method should perform only file inclusion.
+     * Implemented to prevent possibility of changing important and used variables
+     * inside the setup model while installing
+     *
+     * @param string $fileName
+     * @return mixed
+     */
+    protected function _includeFile($fileName)
+    {
+        return include $fileName;
+    }
+
     /**
      * Get data files for modifications
      *
diff --git a/app/code/Magento/Core/Model/Store.php b/app/code/Magento/Core/Model/Store.php
index e84aa810f40b6f6c11c028683bfdadd3271400bc..88f37bea3637a6f584537f617ababf355f8013f1 100644
--- a/app/code/Magento/Core/Model/Store.php
+++ b/app/code/Magento/Core/Model/Store.php
@@ -837,10 +837,11 @@ class Store extends \Magento\Core\Model\AbstractModel
         $code = strtoupper($code);
         if (in_array($code, $this->getAvailableCurrencyCodes())) {
             $this->_getSession()->setCurrencyCode($code);
-            if ($code == $this->getDefaultCurrency()) {
-                $this->_cookie->set(self::COOKIE_CURRENCY, null);
+            $path = $this->_getSession()->getCookiePath();
+            if ($code == $this->getDefaultCurrency()->getCurrencyCode()) {
+                $this->_cookie->set(self::COOKIE_CURRENCY, null, null, $path);
             } else {
-                $this->_cookie->set(self::COOKIE_CURRENCY, $code);
+                $this->_cookie->set(self::COOKIE_CURRENCY, $code, null, $path);
             }
         }
         return $this;
diff --git a/app/code/Magento/Core/Model/Theme/Collection.php b/app/code/Magento/Core/Model/Theme/Collection.php
index 7d20d247aaa1cd188665f46eec8f0c32599f34e6..27fe4a49601e52593783ccf2ab2d7b5e9bc8e709 100644
--- a/app/code/Magento/Core/Model/Theme/Collection.php
+++ b/app/code/Magento/Core/Model/Theme/Collection.php
@@ -139,19 +139,7 @@ class Collection extends \Magento\Data\Collection implements \Magento\View\Desig
 
         $pathsToThemeConfig = array();
         foreach ($this->getTargetPatterns() as $directoryPath) {
-
-            $directoryPath = preg_replace_callback('/[\\\\^$.[\\]|()?*+{}\\-\\/]/', function ($matches) {
-                switch ($matches[0]) {
-                    case '*':
-                        return '.*';
-                    case '?':
-                        return '.';
-                    default:
-                        return '\\' . $matches[0];
-                }
-            }, $directoryPath);
-
-            $themeConfigs = $this->_directory->search('#' . $directoryPath . '#');
+            $themeConfigs = $this->_directory->search($directoryPath);
             foreach ($themeConfigs as &$relPathToTheme) {
                 $relPathToTheme = $this->_directory->getAbsolutePath($relPathToTheme);
             }
diff --git a/app/code/Magento/Core/Model/Website.php b/app/code/Magento/Core/Model/Website.php
index 0461b18e6effe29d6a275853215ce4c0694c72a6..10a33a3d95c6d8a0477a1e11d424b5b341e989da 100644
--- a/app/code/Magento/Core/Model/Website.php
+++ b/app/code/Magento/Core/Model/Website.php
@@ -484,7 +484,7 @@ class Website extends \Magento\Core\Model\AbstractModel
             return false;
         }
         if (is_null($this->_isCanDelete)) {
-            $this->_isCanDelete = ($this->_websiteFactory->create()->getCollection()->getSize() > 2)
+            $this->_isCanDelete = ($this->_websiteFactory->create()->getCollection()->getSize() > 1)
                 && !$this->getIsDefault();
         }
         return $this->_isCanDelete;
diff --git a/app/code/Magento/Customer/Block/Account/Customer.php b/app/code/Magento/Customer/Block/Account/Customer.php
index ce7224319d9a278b63f1ff4fb009fc1ef9286499..b6a6d042bc67319ef08e3bacaf36bbd3c1e64683 100644
--- a/app/code/Magento/Customer/Block/Account/Customer.php
+++ b/app/code/Magento/Customer/Block/Account/Customer.php
@@ -33,26 +33,18 @@ class Customer extends \Magento\View\Element\Template
      */
     protected $_customerSession;
 
-    /**
-     * @var \Magento\Customer\Helper\Data
-     */
-    protected $_customerHelper;
-
     /**
      * @param \Magento\View\Element\Template\Context $context
      * @param \Magento\Customer\Model\Session $session
-     * @param \Magento\Customer\Helper\Data $customerHelper
      * @param array $data
      */
     public function __construct(
         \Magento\View\Element\Template\Context $context,
         \Magento\Customer\Model\Session $session,
-        \Magento\Customer\Helper\Data $customerHelper,
         array $data = array()
     ) {
         parent::__construct($context, $data);
         $this->_customerSession = $session;
-        $this->_customerHelper = $customerHelper;
     }
 
     /**
@@ -71,6 +63,6 @@ class Customer extends \Magento\View\Element\Template
      */
     public function getCustomerName()
     {
-        return $this->_customerHelper->getCustomerName();
+        return $this->escapeHtml($this->_customerSession->getCustomer()->getName());
     }
 }
diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php
index 045629884cc0b21a8fb1bc75050a19d022f77e1b..f2553f4e9b28bd718ac7cb77943b34cd1c76b4e3 100644
--- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php
+++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php
@@ -299,7 +299,7 @@ class Account extends \Magento\Backend\Block\Widget\Form\Generic
             $prefix = $form->getHtmlIdPrefix();
 
             $note = __('Please select a website which contains store view');
-            $form->getElement('website_id')->setAfterElementHtml(
+            $form->getElement('website_id')->setAfterElementJs(
                 '<script type="text/javascript">'
                 . "
                 var {$prefix}_websites = " . $this->_jsonEncoder->encode($websites) . ";
diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php
index 7725cf55fe38e7b12326b6fc0f289a0d38d83ce2..6b6d2448e536f5d5d23aa53773655aff25e6bdc2 100644
--- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php
+++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php
@@ -142,7 +142,7 @@ class View
     public function getCreateDate()
     {
         return $this->formatDate(
-            $this->getCustomer()->getCreatedAtTimestamp(),
+            $this->getCustomer()->getCreatedAt(),
             \Magento\Core\Model\LocaleInterface::FORMAT_TYPE_MEDIUM,
             true
         );
diff --git a/app/code/Magento/Customer/Controller/Account.php b/app/code/Magento/Customer/Controller/Account.php
index 56088595c444028497ca3f7e659f7aae4bdb1c89..41fc6f811ea621c714c81cdf9ed799eba948a7ec 100644
--- a/app/code/Magento/Customer/Controller/Account.php
+++ b/app/code/Magento/Customer/Controller/Account.php
@@ -222,7 +222,7 @@ class Account extends \Magento\App\Action\Action
      */
     public function loginPostAction()
     {
-        if ($this->_getSession()->isLoggedIn()) {
+        if ($this->_getSession()->isLoggedIn() || !$this->_formKeyValidator->validate($this->getRequest())) {
             $this->_redirect('*/*/');
             return;
         }
@@ -286,7 +286,7 @@ class Account extends \Magento\App\Action\Action
                     $referer = $this->getRequest()->getParam(\Magento\Customer\Helper\Data::REFERER_QUERY_PARAM_NAME);
                     if ($referer) {
                         $referer = $this->_objectManager->get('Magento\Core\Helper\Data')->urlDecode($referer);
-                        if ($this->_url->isInternal($referer)) {
+                        if ($this->_url->isOwnOriginUrl()) {
                             $this->_getSession()->setBeforeAuthUrl($referer);
                         }
                     }
diff --git a/app/code/Magento/Customer/Model/Resource/Customer.php b/app/code/Magento/Customer/Model/Resource/Customer.php
index 7d1c1e59d7f14b3bcbcf5e986bee5f31536336fc..8684eab34df4de4663d678cc673f3e6f59ca51f0 100644
--- a/app/code/Magento/Customer/Model/Resource/Customer.php
+++ b/app/code/Magento/Customer/Model/Resource/Customer.php
@@ -139,7 +139,7 @@ class Customer extends \Magento\Eav\Model\Entity\AbstractEntity
         $result = $adapter->fetchOne($select, $bind);
         if ($result) {
             throw new \Magento\Customer\Exception(
-                __('Customer with the same email already exists.'),
+                __('Customer with the same email already exists in associated website.'),
                 \Magento\Customer\Model\Customer::EXCEPTION_EMAIL_EXISTS
             );
         }
diff --git a/app/code/Magento/Customer/etc/module.xml b/app/code/Magento/Customer/etc/module.xml
index d4b96f9ba23d4bf89be5e2974661f3d98b7dfb4d..7100c4120204fc8f4a7d460df13ecf34e37e7d98 100755
--- a/app/code/Magento/Customer/etc/module.xml
+++ b/app/code/Magento/Customer/etc/module.xml
@@ -24,7 +24,7 @@
  */
 -->
 <config>
-    <module name="Magento_Customer" version="1.6.2.0.3" active="true">
+    <module name="Magento_Customer" version="1.6.2.0.5" active="true">
         <sequence>
             <module name="Magento_Eav"/>
             <module name="Magento_Directory"/>
diff --git a/app/code/Magento/Customer/etc/validation.xml b/app/code/Magento/Customer/etc/validation.xml
index 4dcdc1c051e6fdd26fef0272c9dd668a7a2908fd..f49e4ff1908c7e11c0f7e631b555dccf0fdee2fd 100644
--- a/app/code/Magento/Customer/etc/validation.xml
+++ b/app/code/Magento/Customer/etc/validation.xml
@@ -48,7 +48,6 @@
             <rule name="check_eav">
                 <entity_constraints>
                     <constraint alias="eav_data_validator" class="Magento\Eav\Model\Validator\Attribute\Data" />
-                    <constraint alias="eav_backend_validator" class="Magento\Eav\Model\Validator\Attribute\Backend" />
                 </entity_constraints>
             </rule>
         </rules>
diff --git a/app/code/Magento/Customer/sql/customer_setup/upgrade-1.6.2.0.4-1.6.2.0.5.php b/app/code/Magento/Customer/sql/customer_setup/upgrade-1.6.2.0.4-1.6.2.0.5.php
new file mode 100644
index 0000000000000000000000000000000000000000..0921df72889aa1a6bc9bda8b02eb1d64b73cd3f8
--- /dev/null
+++ b/app/code/Magento/Customer/sql/customer_setup/upgrade-1.6.2.0.4-1.6.2.0.5.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @category    Magento
+ * @package     Magento_Customer
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+/** @var $installer \Magento\Customer\Model\Resource\Setup */
+$installer = $this;
+$connection = $installer->getConnection();
+
+/**
+ * Add unique index for customer_entity table
+ */
+$connection->addIndex(
+    $installer->getTable('customer_entity'),
+    $installer->getIdxName('customer_entity', array('email', 'website_id')),
+    array('email', 'website_id'),
+    \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE
+);
\ No newline at end of file
diff --git a/app/code/Magento/Customer/view/frontend/form/login.phtml b/app/code/Magento/Customer/view/frontend/form/login.phtml
index 407bdd903296ceae7c66799e2c42f8745bb82f1b..f3426e4eca2764399e7717c1d5a684d11b5c96d4 100644
--- a/app/code/Magento/Customer/view/frontend/form/login.phtml
+++ b/app/code/Magento/Customer/view/frontend/form/login.phtml
@@ -28,12 +28,14 @@
  * Customer login form template
  *
  * @see \Magento\Customer\Block\Form\Login
+ * @var $this \Magento\Customer\Block\Form\Login
  */
 ?>
 <div class="block customer login">
     <div class="title"><strong><?php echo __('Registered Customers') ?></strong></div>
     <div class="content">
         <form class="form login" action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
+            <?php echo $this->getBlockHtml('formkey'); ?>
             <fieldset class="fieldset login" data-hasrequired="<?php echo __('* Required Fields') ?>">
                 <p class="field note"><?php echo __('If you have an account with us, log in using your email address.') ?></p>
                 <div class="field email required">
diff --git a/app/code/Magento/Directory/data/directory_setup/data-upgrade-1.6.0.1-1.6.0.2.php b/app/code/Magento/Directory/data/directory_setup/data-upgrade-1.6.0.1-1.6.0.2.php
new file mode 100644
index 0000000000000000000000000000000000000000..b96cb6c6eb83a44cf75fbd5aebd5e8817178bafe
--- /dev/null
+++ b/app/code/Magento/Directory/data/directory_setup/data-upgrade-1.6.0.1-1.6.0.2.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @category    Magento
+ * @package     Magento_Directory
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+/**
+ * @var \Magento\Directory\Model\Resource\Setup $installer
+ */
+$installer = $this;
+
+$data = array(
+    array('BR', 'AC', 'Acre'), array('BR', 'AL', 'Alagoas'), array('BR', 'AP', 'Amapá'), array('BR', 'AM', 'Amazonas'),
+    array('BR', 'BA', 'Bahia'), array('BR', 'CE', 'Ceará'), array('BR', 'ES', 'Espírito Santo'),
+    array('BR', 'GO', 'Goiás'), array('BR', 'MA', 'Maranhão'), array('BR', 'MT', 'Mato Grosso'),
+    array('BR', 'MS', 'Mato Grosso do Sul'), array('BR', 'MG', 'Minas Gerais'), array('BR', 'PA', 'Pará'),
+    array('BR', 'PB', 'Paraíba'), array('BR', 'PR', 'Paraná'), array('BR', 'PE', 'Pernambuco'),
+    array('BR', 'PI', 'Piauí'), array('BR', 'RJ', 'Rio de Janeiro'), array('BR', 'RN', 'Rio Grande do Norte'),
+    array('BR', 'RS', 'Rio Grande do Sul'), array('BR', 'RO', 'Rondônia'), array('BR', 'RR', 'Roraima'),
+    array('BR', 'SC', 'Santa Catarina'), array('BR', 'SP', 'São Paulo'), array('BR', 'SE', 'Sergipe'),
+    array('BR', 'TO', 'Tocantins'), array('BR', 'DF', 'Distrito Federal'),
+);
+
+foreach ($data as $row) {
+    $bind = array(
+        'country_id'    => $row[0],
+        'code'          => $row[1],
+        'default_name'  => $row[2],
+    );
+    $installer->getConnection()->insert($installer->getTable('directory_country_region'), $bind);
+    $regionId = $installer->getConnection()->lastInsertId($installer->getTable('directory_country_region'));
+
+    $bind = array(
+        'locale'    => 'en_US',
+        'region_id' => $regionId,
+        'name'      => $row[2]
+    );
+    $installer->getConnection()->insert($installer->getTable('directory_country_region_name'), $bind);
+}
diff --git a/app/code/Magento/Directory/etc/module.xml b/app/code/Magento/Directory/etc/module.xml
index 0eb574bb6b3cffc3f3ce55a560e329ad90b06259..9d80b2eb55617ea630adc5e5cbd821e617eca601 100755
--- a/app/code/Magento/Directory/etc/module.xml
+++ b/app/code/Magento/Directory/etc/module.xml
@@ -24,7 +24,7 @@
  */
 -->
 <config>
-    <module name="Magento_Directory" version="1.6.0.1" active="true">
+    <module name="Magento_Directory" version="1.6.0.2" active="true">
         <sequence>
             <module name="Magento_Core"/>
         </sequence>
diff --git a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php
index 3f26db29f47c8db1d466d511a82eef10a8770f6e..d97556aa889e04d111345945b628623daf382f5a 100644
--- a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php
+++ b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php
@@ -51,20 +51,28 @@ class Downloadable extends \Magento\Sales\Block\Order\Email\Items\DefaultItems
      */
     protected $_itemsFactory;
 
+    /**
+     * @var \Magento\Core\Model\Url
+     */
+    protected $urlGenerator;
+
     /**
      * @param \Magento\View\Element\Template\Context $context
      * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory
      * @param \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory
+     * @param \Magento\Core\Model\Url $urlGenerator
      * @param array $data
      */
     public function __construct(
         \Magento\View\Element\Template\Context $context,
         \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory,
         \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory,
+        \Magento\Core\Model\Url $urlGenerator,
         array $data = array()
     ) {
         $this->_purchasedFactory = $purchasedFactory;
         $this->_itemsFactory = $itemsFactory;
+        $this->urlGenerator = $urlGenerator;
         parent::__construct($context, $data);
     }
 
@@ -94,7 +102,7 @@ class Downloadable extends \Magento\Sales\Block\Order\Email\Items\DefaultItems
 
     public function getPurchasedLinkUrl($item)
     {
-        return $this->getUrl('downloadable/download/link', array(
+        return $this->urlGenerator->getUrl('downloadable/download/link', array(
             'id'        => $item->getLinkHash(),
             '_store'    => $this->getOrder()->getStore(),
             '_secure'   => true,
diff --git a/app/code/Magento/Downloadable/etc/di.xml b/app/code/Magento/Downloadable/etc/di.xml
index b441b22d71d66dce64a17067792de02098aaa51c..11072f00e288e24860db9adfb6b1b23c413ed5c1 100644
--- a/app/code/Magento/Downloadable/etc/di.xml
+++ b/app/code/Magento/Downloadable/etc/di.xml
@@ -41,4 +41,9 @@
             </value>
         </param>
     </type>
+    <type name="Magento\Downloadable\Block\Sales\Order\Email\Items\Downloadable">
+        <param name="urlGenerator">
+            <instance type="Magento\Core\Model\Url\Proxy"/>
+        </param>
+    </type>
 </config>
diff --git a/app/code/Magento/Downloadable/view/frontend/checkout/cart/item/default.phtml b/app/code/Magento/Downloadable/view/frontend/checkout/cart/item/default.phtml
index cd08fb99f34662036c4b61169dbb81e2e51b315d..6a3ccabaa35f8ee6d294efb92911eac1463d3e49 100644
--- a/app/code/Magento/Downloadable/view/frontend/checkout/cart/item/default.phtml
+++ b/app/code/Magento/Downloadable/view/frontend/checkout/cart/item/default.phtml
@@ -187,7 +187,7 @@ $canApplyMsrp = $this->helper('Magento\Catalog\Helper\Data')->canApplyMsrp($_ite
     <?php endif; ?>
         <td class="col qty">
             <div class="control qty">
-                <input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" type="text" size="4" title="<?php echo __('Qty') ?>" class="input-text qty" maxlength="12" data-validate="{required:true,'validate-greater-than-zero':true}"/>
+                <input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" type="number" size="4" title="<?php echo __('Qty') ?>" class="input-text qty" maxlength="12" data-validate="{required:true,'validate-greater-than-zero':true}"/>
             </div>
             <?php $cols++; ?>
         </td>
diff --git a/app/code/Magento/Downloadable/view/frontend/customer/products/list.phtml b/app/code/Magento/Downloadable/view/frontend/customer/products/list.phtml
index c0e12644d00d9089598964c26d04f795498b454a..c64a730f985316415d7b40f08621db3a5e7e26a2 100644
--- a/app/code/Magento/Downloadable/view/frontend/customer/products/list.phtml
+++ b/app/code/Magento/Downloadable/view/frontend/customer/products/list.phtml
@@ -32,34 +32,36 @@
     <?php echo $this->getChildHtml('pager'); ?>
 </div>
 <?php if(count($_items)): ?>
-    <table id="my-downloadable-products-table" class="data table downloadable products">
-        <thead>
-            <tr>
-                <th class="col id"><?php echo __('Order #') ?></th>
-                <th class="col date"><?php echo __('Date') ?></th>
-                <th class="col title"><?php echo __('Title') ?></th>
-                <th class="col status"><?php echo __('Status') ?></th>
-                <th class="col remaining"><?php echo __('Remaining Downloads') ?></th>
-            </tr>
-        </thead>
-        <tbody>
-        <?php foreach ($_items as $_item): ?>
-            <tr>
-                <td class="col id">
-                    <a href="<?php echo $this->getOrderViewUrl($_item->getPurchased()->getOrderId()) ?>" title="<?php echo __('View Order') ?>">
-                        <?php echo $_item->getPurchased()->getOrderIncrementId() ?>
-                    </a>
-                </td>
-                <td class="col date"><?php echo $this->formatDate($_item->getPurchased()->getCreatedAt()) ?></td>
-                <td class="col title">
-                    <?php echo $this->escapeHtml($_item->getPurchased()->getProductName()) ?> - <a href="<?php echo $this->getDownloadUrl($_item) ?>" title="<?php echo __('Start Download') ?>" <?php echo $this->getIsOpenInNewWindow()?'onclick="this.target=\'_blank\'"':''; ?>><?php echo $this->escapeHtml($_item->getLinkTitle()) ?></a>
-                </td>
-                <td class="col status"><?php echo __(ucfirst($_item->getStatus())) ?></td>
-                <td class="col remaining"><?php echo $this->getRemainingDownloads($_item) ?></td>
-            </tr>
-        <?php endforeach; ?>
-        </tbody>
-    </table>
+    <div class="wrapper table downloadable products">
+        <table id="my-downloadable-products-table" class="data table downloadable products">
+            <thead>
+                <tr>
+                    <th class="col id"><?php echo __('Order #') ?></th>
+                    <th class="col date"><?php echo __('Date') ?></th>
+                    <th class="col title"><?php echo __('Title') ?></th>
+                    <th class="col status"><?php echo __('Status') ?></th>
+                    <th class="col remaining"><?php echo __('Remaining Downloads') ?></th>
+                </tr>
+            </thead>
+            <tbody>
+            <?php foreach ($_items as $_item): ?>
+                <tr>
+                    <td class="col id">
+                        <a href="<?php echo $this->getOrderViewUrl($_item->getPurchased()->getOrderId()) ?>" title="<?php echo __('View Order') ?>">
+                            <?php echo $_item->getPurchased()->getOrderIncrementId() ?>
+                        </a>
+                    </td>
+                    <td class="col date"><?php echo $this->formatDate($_item->getPurchased()->getCreatedAt()) ?></td>
+                    <td class="col title">
+                        <?php echo $this->escapeHtml($_item->getPurchased()->getProductName()) ?> - <a href="<?php echo $this->getDownloadUrl($_item) ?>" title="<?php echo __('Start Download') ?>" <?php echo $this->getIsOpenInNewWindow()?'onclick="this.target=\'_blank\'"':''; ?>><?php echo $this->escapeHtml($_item->getLinkTitle()) ?></a>
+                    </td>
+                    <td class="col status"><?php echo __(ucfirst($_item->getStatus())) ?></td>
+                    <td class="col remaining"><?php echo $this->getRemainingDownloads($_item) ?></td>
+                </tr>
+            <?php endforeach; ?>
+            </tbody>
+        </table>
+    </div>
 <?php else: ?>
     <div class="message info empty"><span><?php echo __('You have not purchased any downloadable products yet.'); ?></span></div>
 <?php endif; ?>
diff --git a/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php b/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php
index 4452d8b1e32cb4c316c22554853305559bc7007a..2f79a46815a7bc9b61d050d8ae653c919ee2986e 100644
--- a/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php
+++ b/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php
@@ -419,12 +419,12 @@ class Edit extends \Magento\Backend\Block\Widget
         if ($paths) {
             /** @var $menu \Magento\Backend\Model\Menu */
             $menu = $this->_menuConfig->getMenu();
-            $item = $menu->get('Magento_Adminhtml::system');
+            $item = $menu->get('Magento_Backend::stores');
             // create prefix path parts
             $prefixParts[] = array(
                 'title' => __($item->getTitle()),
             );
-            $item = $menu->get('Magento_Adminhtml::system_config');
+            $item = $menu->get('Magento_Backend::system_config');
             $prefixParts[] = array(
                 'title' => __($item->getTitle()),
                 'url' => $this->getUrl('adminhtml/system_config/'),
diff --git a/app/code/Magento/Email/Model/Template/Config/FileResolver.php b/app/code/Magento/Email/Model/Template/Config/FileResolver.php
index 3c1d4b72145ff088982b41a9ef83776cd18559cc..e9cf19ad46afafb95b3a6de0676f60d889565c9c 100644
--- a/app/code/Magento/Email/Model/Template/Config/FileResolver.php
+++ b/app/code/Magento/Email/Model/Template/Config/FileResolver.php
@@ -45,7 +45,7 @@ class FileResolver implements \Magento\Config\FileResolverInterface
         \Magento\Filesystem $filesystem,
         \Magento\Email\Model\Template\Config\FileIteratorFactory $iteratorFactory
     ) {
-        $this->directoryRead = $filesystem->getDirectoryRead(\Magento\Filesystem::APP);
+        $this->directoryRead = $filesystem->getDirectoryRead(\Magento\Filesystem::MODULES);
         $this->iteratorFactory = $iteratorFactory;
     }
 
@@ -55,10 +55,8 @@ class FileResolver implements \Magento\Config\FileResolverInterface
     public function get($filename, $scope)
     {
         $iterator = $this->iteratorFactory->create(
-            array(
-                'directory' => $this->directoryRead,
-                'paths' => $this->directoryRead->search('#' . preg_quote($filename) . '$#')
-            )
+            $this->directoryRead,
+            $this->directoryRead->search('/*/*/etc/' . $filename)
         );
         return $iterator;
     }
diff --git a/app/code/Magento/GiftMessage/view/adminhtml/giftoptionsform.phtml b/app/code/Magento/GiftMessage/view/adminhtml/giftoptionsform.phtml
index 4ce4c4d8056952b174f59b2eac4bb59dee1d424d..f4092fe212ad9747e29bb2c4904506cc2f4fe528 100644
--- a/app/code/Magento/GiftMessage/view/adminhtml/giftoptionsform.phtml
+++ b/app/code/Magento/GiftMessage/view/adminhtml/giftoptionsform.phtml
@@ -46,10 +46,4 @@
         </div>
     </div>
 </div>
-
-<script type="text/javascript">
-//<![CDATA[
-var giftMessageSet = new GiftMessageSet();
-//]]>
-</script>
 <?php endif; ?>
diff --git a/app/code/Magento/GiftMessage/view/adminhtml/popup.phtml b/app/code/Magento/GiftMessage/view/adminhtml/popup.phtml
index 224393a9f4c10a2df2d814d4439af9950e53bcc1..4f6cc8df0170d1eb7207499a5362308a65c8c45b 100644
--- a/app/code/Magento/GiftMessage/view/adminhtml/popup.phtml
+++ b/app/code/Magento/GiftMessage/view/adminhtml/popup.phtml
@@ -43,6 +43,8 @@
 
 <script type="text/javascript">
 //<![CDATA[
+var giftMessageSet = new GiftMessageSet();
+
 _giftOptions = new GiftOptionsPopup();
 giftOptionsTooltip.setTooltipWindow('giftoptions_tooltip_window','giftoptions_tooltip_window_content');
 //]]>
diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php
index 1721d4eee829b87809fd75d43dde8de4a5403068..9de6334d67d968a6f7cfff82a273fa75695fe624 100644
--- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php
+++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Types.php
@@ -60,11 +60,15 @@ class Types extends \Magento\Backend\App\Action
      */
     public function dispatch(RequestInterface $request)
     {
-        parent::dispatch($request);
-        if ($this->_actionFlag->get('', self::FLAG_NO_POST_DISPATCH)) {
-            return $this->_response;
+        $response = parent::dispatch($request);
+        if (!$this->_actionFlag->get('', self::FLAG_NO_POST_DISPATCH)) {
+            $this->_eventManager->dispatch(
+                'controller_action_postdispatch_adminhtml',
+                array('controller_action' => $this)
+            );
         }
-        $this->_eventManager->dispatch('controller_action_postdispatch_adminhtml', array('controller_action' => $this));
+        return $response;
+
     }
 
     /**
diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/Product.php b/app/code/Magento/ImportExport/Model/Import/Entity/Product.php
index e94052612a525f76289c9ee5942836ed1c01bac1..61dfd2974040eb4654ed6d234ef2c8d468ac1602 100644
--- a/app/code/Magento/ImportExport/Model/Import/Entity/Product.php
+++ b/app/code/Magento/ImportExport/Model/Import/Entity/Product.php
@@ -1033,6 +1033,16 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
                             'value'          => $storeValue
                         );
                     }
+                    /*
+                    If the store based values are not provided for a particular store,
+                    we default to the default scope values.
+                    In this case, remove all the existing store based values stored in the table.
+                    */
+                    $where = $this->_connection->quoteInto('store_id NOT IN (?)', array_keys($storeValues)) .
+                        $this->_connection->quoteInto(' AND attribute_id = ?', $attributeId) .
+                        $this->_connection->quoteInto(' AND entity_id = ?', $productId) .
+                        $this->_connection->quoteInto(' AND entity_type_id = ?', $this->_entityTypeId);
+                    $this->_connection->delete($tableName, $where);
                 }
             }
             $this->_connection->insertOnDuplicate($tableName, $tableData, array('value'));
diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/Product/Type/AbstractType.php b/app/code/Magento/ImportExport/Model/Import/Entity/Product/Type/AbstractType.php
index e9dfe7d7b66a2c44348add83caf7ac287a5ccec2..3a6e8cca0322e2fe12a23f37f82e01e700bc20ee 100644
--- a/app/code/Magento/ImportExport/Model/Import/Entity/Product/Type/AbstractType.php
+++ b/app/code/Magento/ImportExport/Model/Import/Entity/Product/Type/AbstractType.php
@@ -259,10 +259,10 @@ abstract class AbstractType
      *
      * @param array $rowData
      * @param int $rowNum
-     * @param boolean $checkRequiredAttributes OPTIONAL Flag which can disable validation required values.
+     * @param boolean $isNewProduct OPTIONAL
      * @return boolean
      */
-    public function isRowValid(array $rowData, $rowNum, $checkRequiredAttributes = true)
+    public function isRowValid(array $rowData, $rowNum, $isNewProduct = true)
     {
         $error    = false;
         $rowScope = $this->_entityModel->getRowScope($rowData);
@@ -272,16 +272,19 @@ abstract class AbstractType
                 // check value for non-empty in the case of required attribute?
                 if (isset($rowData[$attrCode]) && strlen($rowData[$attrCode])) {
                     $error |= !$this->_entityModel->isAttributeValid($attrCode, $attrParams, $rowData, $rowNum);
-                } elseif (
-                    $this->_isAttributeRequiredCheckNeeded($attrCode)
-                    && $checkRequiredAttributes
-                    && \Magento\ImportExport\Model\Import\Entity\Product::SCOPE_DEFAULT == $rowScope
-                    && $attrParams['is_required']
-                ) {
-                    $this->_entityModel->addRowError(
-                        \Magento\ImportExport\Model\Import\Entity\Product::ERROR_VALUE_IS_REQUIRED, $rowNum, $attrCode
-                    );
-                    $error = true;
+                } elseif ($this->_isAttributeRequiredCheckNeeded($attrCode) && $attrParams['is_required']) {
+                    // For the default scope - if this is a new product or
+                    // for an old product, if the imported doc has the column present for the attrCode
+                    if (\Magento\ImportExport\Model\Import\Entity\Product::SCOPE_DEFAULT == $rowScope &&
+                        ($isNewProduct || array_key_exists($attrCode, $rowData))
+                    ) {
+                        $this->_entityModel->addRowError(
+                            \Magento\ImportExport\Model\Import\Entity\Product::ERROR_VALUE_IS_REQUIRED,
+                            $rowNum,
+                            $attrCode
+                        );
+                        $error = true;
+                    }
                 }
             }
         }
diff --git a/app/code/Magento/ImportExport/view/adminhtml/export/form/before.phtml b/app/code/Magento/ImportExport/view/adminhtml/export/form/before.phtml
index 66cfe12cfca1550b9cad758006ed4cc0591c610e..4224354e5323b94c83ea580d7b404b3a044bf30e 100644
--- a/app/code/Magento/ImportExport/view/adminhtml/export/form/before.phtml
+++ b/app/code/Magento/ImportExport/view/adminhtml/export/form/before.phtml
@@ -42,7 +42,6 @@
          */
         modifyFilterGrid: function() {
             if ($('entity') && $F('entity') && $F('entity') != 'catalog_product') {
-                if ($F('entity') == 'customer') {
                     $$('col:first-child').each(function(el) {
                         el.show();
                     });
@@ -52,17 +51,6 @@
                     $$('td.a-center').each(function(el) {
                         el.show();
                     });
-                } else {
-                    $$('col:first-child').each(function(el) {
-                        el.hide();
-                    });
-                    $$('th.no-link:first-child').each(function(el) {
-                        el.hide();
-                    });
-                    $$('td.a-center').each(function(el) {
-                        el.hide();
-                    });
-                }
             }
         },
 
@@ -73,9 +61,6 @@
             if ($('entity') && $F('entity')) {
                 var url    = "<?php echo $this->getUrl('*/*/getFilter') ?>";
                 var entity = $F('entity');
-                if (entity != 'catalog_product') {
-                    entity = 'customer';
-                }
                 if (entity != this.previousGridEntity) {
                     this.previousGridEntity = entity;
                     url += ((url.slice(-1) != '/') ? '/' : '') + 'entity/' + entity;
diff --git a/app/code/Magento/Install/Model/Installer.php b/app/code/Magento/Install/Model/Installer.php
index 36ac343c952e364672c19164055c5f94468375d7..180d6a26b32b45387c720e80528f95282c3b7ef3 100644
--- a/app/code/Magento/Install/Model/Installer.php
+++ b/app/code/Magento/Install/Model/Installer.php
@@ -479,12 +479,9 @@ class Installer extends \Magento\Object
      */
     public function finish()
     {
-        $this->_installerConfig->replaceTmpInstallDate();
-
+        $this->_setAppInstalled();
         $this->_refreshConfig();
 
-        $this->_config->reinit();
-
         /* Enable all cache types */
         foreach (array_keys($this->_cacheTypeList->getTypes()) as $cacheTypeCode) {
             $this->_cacheState->setEnabled($cacheTypeCode, true);
@@ -493,6 +490,16 @@ class Installer extends \Magento\Object
         return $this;
     }
 
+    /**
+     * Store install date and set application into installed state
+     */
+    protected function _setAppInstalled()
+    {
+        $dateTime = date('r');
+        $this->_installerConfig->replaceTmpInstallDate($dateTime);
+        $this->_appState->setInstallDate($dateTime);
+    }
+
     /**
      * Ensure changes in the configuration, if any, take effect
      */
diff --git a/app/code/Magento/Install/Model/Installer/Config.php b/app/code/Magento/Install/Model/Installer/Config.php
index 0486ecc040ef66cb014e2c86b6bcb74237cf91ff..a95f39d3e70bde38c4096bdd17895fd1e6900a40 100644
--- a/app/code/Magento/Install/Model/Installer/Config.php
+++ b/app/code/Magento/Install/Model/Installer/Config.php
@@ -53,6 +53,11 @@ class Config extends \Magento\Install\Model\Installer\AbstractInstaller
      */
     protected $_filesystem;
 
+    /**
+     * @var \Magento\Filesystem\Directory\ReadInterface
+     */
+    protected $_pubDirectory;
+
     /**
      * @var \Magento\Filesystem\Directory\Write
      */
@@ -88,6 +93,7 @@ class Config extends \Magento\Install\Model\Installer\AbstractInstaller
         $this->_request = $request;
         $this->_storeManager = $storeManager;
         $this->_filesystem = $filesystem;
+        $this->_pubDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::PUB_LIB);
         $this->_configDirectory = $filesystem->getDirectoryWrite(\Magento\Filesystem::CONFIG);
         $this->messageManager = $messageManager;
     }
@@ -198,10 +204,7 @@ class Config extends \Magento\Install\Model\Installer\AbstractInstaller
     protected function _checkUrl($baseUrl)
     {
         try {
-            $directory = $this->_filesystem->getDirectoryRead(\Magento\Filesystem::PUB_LIB);
-            $files = $directory->search('/.+\.(html?|js|css|gif|jpe?g|png)$/');
-
-            $staticFile = isset($files[0]) ? $files[0] : null;
+            $staticFile = $this->_findFirstFileRelativePath('', '/.+\.(html?|js|css|gif|jpe?g|png)$/');
             $staticUrl = $baseUrl . $this->_filesystem->getUri(\Magento\Filesystem::PUB_LIB) . '/' . $staticFile;
             $client = new \Magento\HTTP\ZendClient($staticUrl);
             $response = $client->request('GET');
@@ -219,6 +222,35 @@ class Config extends \Magento\Install\Model\Installer\AbstractInstaller
         }
     }
 
+    /**
+     * Find a relative path to a first file located in a directory or its descendants
+     *
+     * @param string $dir Directory to search for a file within
+     * @param string $pattern PCRE pattern a file name has to match
+     * @return string|null
+     */
+    protected function _findFirstFileRelativePath($dir, $pattern = '/.*/')
+    {
+        $childDirs = array();
+        foreach ($this->_pubDirectory->read($dir) as $itemName) {
+            $itemPath = $dir . '/' . $itemName;
+            if ($this->_pubDirectory->isFile($itemPath)) {
+                if (preg_match($pattern, $itemName)) {
+                    return $itemName;
+                }
+            } else {
+                $childDirs[$itemName] = $itemPath;
+            }
+        }
+        foreach ($childDirs as $dirName => $dirPath) {
+            $filePath = $this->_findFirstFileRelativePath($dirPath, $pattern);
+            if ($filePath) {
+                return $dirName . '/' . $filePath;
+            }
+        }
+        return null;
+    }
+
     public function replaceTmpInstallDate($date = 'now')
     {
         $stamp    = strtotime((string) $date);
diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Problem/Grid/Filter/Checkbox.php b/app/code/Magento/Newsletter/Block/Adminhtml/Problem/Grid/Filter/Checkbox.php
index ade99b2f93586af46ae3fcce95e9648d8179789f..34d7a97babf847fae559d8c305eed7243658a5b6 100644
--- a/app/code/Magento/Newsletter/Block/Adminhtml/Problem/Grid/Filter/Checkbox.php
+++ b/app/code/Magento/Newsletter/Block/Adminhtml/Problem/Grid/Filter/Checkbox.php
@@ -36,7 +36,7 @@ namespace Magento\Newsletter\Block\Adminhtml\Problem\Grid\Filter;
 
 class Checkbox extends \Magento\Backend\Block\Widget\Grid\Column\Filter\AbstractFilter
 {
-     public function getCondition()
+    public function getCondition()
     {
         return array();
     }
diff --git a/app/code/Magento/Newsletter/view/adminhtml/preview/iframeswitcher.phtml b/app/code/Magento/Newsletter/view/adminhtml/preview/iframeswitcher.phtml
index 945708a62ee0a69365ea03868dc9b8733e2afb1f..3cb27d1f644b721fb341c561ba188e59e273830f 100644
--- a/app/code/Magento/Newsletter/view/adminhtml/preview/iframeswitcher.phtml
+++ b/app/code/Magento/Newsletter/view/adminhtml/preview/iframeswitcher.phtml
@@ -42,7 +42,7 @@
         </div>
         <?php endif;?>
     </div>
-    <iframe name="preview_iframe" id="preview_iframe" frameborder="0"></iframe>
+    <iframe name="preview_iframe" id="preview_iframe" frameborder="0" title="<?php echo __('Preview') ?>" width="100%" onload="iframeSetHeight()"></iframe>
     <?php echo $this->getChildHtml('preview_form'); ?>
 </div>
 
@@ -69,6 +69,15 @@ function unBlockPreview() {
 
 Event.observe(window, 'load', preview);
 Event.observe(previewIframe, 'load', unBlockPreview);
+
+function iframeSetHeight() {
+    var iFrameID = document.getElementById('preview_iframe');
+    if(iFrameID) {
+        iFrameID.height = "";
+        iFrameID.height = iFrameID.contentWindow.document.body.scrollHeight + "px";
+    }
+}
+
 //]]>
 </script>
 </body>
diff --git a/app/code/Magento/Payment/view/frontend/form/cc.phtml b/app/code/Magento/Payment/view/frontend/form/cc.phtml
index d2cdc7b285f3eb9af3151f6c85da48b294f98a7a..e5d8b7aa83e52c17c417babf7ae57a88fbb9202c 100644
--- a/app/code/Magento/Payment/view/frontend/form/cc.phtml
+++ b/app/code/Magento/Payment/view/frontend/form/cc.phtml
@@ -40,7 +40,7 @@
     <div class="field number required">
         <label for="<?php echo $_code ?>_cc_number" class="label"><span><?php echo __('Credit Card Number') ?></span></label>
         <div class="control">
-            <input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo __('Credit Card Number') ?>" class="input-text" value="" data-validate='{required:true, "validate-cc-number":"#<?php echo $_code ?>_cc_type", "validate-cc-type":"#<?php echo $_code ?>_cc_type"}'/>
+            <input type="number" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo __('Credit Card Number') ?>" class="input-text" value="" data-validate='{required:true, "validate-cc-number":"#<?php echo $_code ?>_cc_type", "validate-cc-type":"#<?php echo $_code ?>_cc_type"}'/>
         </div>
     </div>
     <div class="field date required" id="<?php echo $_code ?>_cc_type_exp_div">
@@ -74,7 +74,7 @@
     <div class="field cvv required" id="<?php echo $_code ?>_cc_type_cvv_div">
         <label for="<?php echo $_code ?>_cc_cid" class="label"><span><?php echo __('Card Verification Number') ?></span></label>
         <div class="control">
-            <input type="text" title="<?php echo __('Card Verification Number') ?>" class="input-text cvv" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" data-validate='{required:true, "validate-cc-cvn":"#<?php echo $_code ?>_cc_type"}' />
+            <input type="number" title="<?php echo __('Card Verification Number') ?>" class="input-text cvv" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" data-validate='{required:true, "validate-cc-cvn":"#<?php echo $_code ?>_cc_type"}' />
             <div class="note">
                 <a href="#" class="action cvv" data-mage-init='{toggleAdvanced: {toggleContainers: "#<?php echo $_code ?>_cc_type_cvv_div .tooltip"}}'><span><?php echo __('What is this?') ?></span></a>
             </div>
diff --git a/app/code/Magento/Payment/view/frontend/form/ccsave.phtml b/app/code/Magento/Payment/view/frontend/form/ccsave.phtml
index 5019764e241d87df74b789c3708a8737906607c5..d48de069c20b7128c29a6a8e16a6156dd030aa6b 100644
--- a/app/code/Magento/Payment/view/frontend/form/ccsave.phtml
+++ b/app/code/Magento/Payment/view/frontend/form/ccsave.phtml
@@ -46,7 +46,7 @@
     <div class="field number required">
         <label for="<?php echo $_code ?>_cc_number" class="label"><span><?php echo __('Credit Card Number') ?></span></label>
         <div class="control">
-            <input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo __('Credit Card Number') ?>" class="input-text" value="" data-validate='{required:true, "validate-cc-number":"#<?php echo $_code ?>_cc_type", "validate-cc-type":"#<?php echo $_code ?>_cc_type"}'/>
+            <input type="number" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo __('Credit Card Number') ?>" class="input-text" value="" data-validate='{required:true, "validate-cc-number":"#<?php echo $_code ?>_cc_type", "validate-cc-type":"#<?php echo $_code ?>_cc_type"}'/>
         </div>
     </div>
     <div class="field date required">
@@ -80,7 +80,7 @@
     <div class="field cvv required">
         <label for="<?php echo $_code ?>_cc_cid" class="label"><span><?php echo __('Card Verification Number') ?></span></label>
         <div class="control">
-                <input type="text" title="<?php echo __('Card Verification Number') ?>" class="input-text cvv" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" data-validate='{required:true, "validate-cc-cvn":"#<?php echo $_code ?>_cc_type"}'/>
+                <input type="number" title="<?php echo __('Card Verification Number') ?>" class="input-text cvv" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" data-validate='{required:true, "validate-cc-cvn":"#<?php echo $_code ?>_cc_type"}'/>
             <div class="note">
                 <a href="#" class="action cvv" data-mage-init='{toggleAdvanced: {toggleContainers:"#ccv-save-tooltip"}}'><span><?php echo __('What is this?') ?></span></a>
             </div>
diff --git a/app/code/Magento/Paypal/Block/Iframe.php b/app/code/Magento/Paypal/Block/Iframe.php
index 6b89856b1334775eea50b4073fe2acda958b9e1f..559b7fc104da182e79573753909c478f262249d1 100644
--- a/app/code/Magento/Paypal/Block/Iframe.php
+++ b/app/code/Magento/Paypal/Block/Iframe.php
@@ -114,7 +114,7 @@ class Iframe extends \Magento\Payment\Block\Form
             $templatePath = str_replace('_', '', $paymentCode);
             $templateFile = "{$templatePath}/iframe.phtml";
 
-            $directory = $this->getDirectory();
+            $directory = $this->_filesystem->getDirectoryRead(\Magento\Filesystem::MODULES);
             $file = $this->_viewFileSystem->getFilename($templateFile, array('module' => 'Magento_Paypal'));
             if ($directory->isExist($directory->getRelativePath($file))) {
                 $this->setTemplate($templateFile);
diff --git a/app/code/Magento/Paypal/Model/Cert.php b/app/code/Magento/Paypal/Model/Cert.php
index fd4fa12c8ed81dd9208346a34f037d8e3b10d444..0ac1b5c216f1151e412b48315d45598ec48149b2 100644
--- a/app/code/Magento/Paypal/Model/Cert.php
+++ b/app/code/Magento/Paypal/Model/Cert.php
@@ -134,8 +134,7 @@ class Cert extends \Magento\Core\Model\AbstractModel
      */
     protected function _removeOutdatedCertFile()
     {
-        $pattern = sprintf('#cert_%s#' . $this->getWebsiteId());
-
+        $pattern = sprintf('cert_%s*' . $this->getWebsiteId());
         $entries = $this->varDirectory->search($pattern, self::BASEPATH_PAYPAL_CERT);
         foreach ($entries as $entry) {
             $this->varDirectory->delete($entry);
diff --git a/app/code/Magento/ProductAlert/Block/Product/View/Price.php b/app/code/Magento/ProductAlert/Block/Product/View/Price.php
index 8f175d4fbc41d7c2ac84c6b8ff90ef691778e500..b605b4c86e6657e8328a0cadf0dee1088fb7dfa0 100644
--- a/app/code/Magento/ProductAlert/Block/Product/View/Price.php
+++ b/app/code/Magento/ProductAlert/Block/Product/View/Price.php
@@ -34,18 +34,18 @@ class Price extends \Magento\ProductAlert\Block\Product\View
     /**
      * Prepare price info
      *
-     * @return void
+     * @param string $template
+     * @return \Magento\View\Element\Template
      */
-    protected function _prepareLayout()
+    public function setTemplate($template)
     {
-        parent::_prepareLayout();
         if (!$this->_helper->isPriceAlertAllowed()
             || !$this->_product || false === $this->_product->getCanShowPrice()
         ) {
-            $this->setTemplate('');
-            return;
+            $template = '';
+        } else {
+            $this->setSignupUrl($this->_helper->getSaveUrl('price'));
         }
-        $this->setSignupUrl($this->_helper->getSaveUrl('price'));
+        return parent::setTemplate($template);
     }
-
 }
diff --git a/app/code/Magento/ProductAlert/Block/Product/View/Stock.php b/app/code/Magento/ProductAlert/Block/Product/View/Stock.php
index 024770647ef9bc537492c294fa6dd98347501e64..e08cb0c07019de11a462acb3169bcea78e3b99da 100644
--- a/app/code/Magento/ProductAlert/Block/Product/View/Stock.php
+++ b/app/code/Magento/ProductAlert/Block/Product/View/Stock.php
@@ -34,15 +34,16 @@ class Stock extends \Magento\ProductAlert\Block\Product\View
     /**
      * Prepare stock info
      *
-     * @return void
+     * @param string $template
+     * @return \Magento\View\Element\Template
      */
-    protected function _prepareLayout()
+    public function setTemplate($template)
     {
-        parent::_prepareLayout();
         if (!$this->_helper->isStockAlertAllowed() || !$this->_product || $this->_product->isAvailable()) {
-            $this->setTemplate('');
-            return;
+            $template = '';
+        } else {
+            $this->setSignupUrl($this->_helper->getSaveUrl('stock'));
         }
-        $this->setSignupUrl($this->_helper->getSaveUrl('stock'));
+        return parent::setTemplate($template);
     }
 }
diff --git a/app/code/Magento/Reports/Block/Adminhtml/Grid/Column/Renderer/Customer.php b/app/code/Magento/Reports/Block/Adminhtml/Grid/Column/Renderer/Customer.php
index 6c9243ffc132cd21149a0cb44f45c0df0d4a1a0c..c82dd5676496c7434c29cf594488b04848ab699f 100644
--- a/app/code/Magento/Reports/Block/Adminhtml/Grid/Column/Renderer/Customer.php
+++ b/app/code/Magento/Reports/Block/Adminhtml/Grid/Column/Renderer/Customer.php
@@ -52,7 +52,7 @@ class Customer
         }
 
         return sprintf('<a href="%s">%s</a>',
-            $this->getUrl('adminhtml/catalog_product_review', array('customerId' => $id)),
+            $this->getUrl('catalog/product_review/', array('customerId' => $id)),
             __('Show Reviews')
         );
     }
diff --git a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml
index 99b91464070abf05d710d722f5d7d2df11f9c46d..254f4fc7961901c9481fb699b97d8bd2909e6005 100644
--- a/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml
+++ b/app/code/Magento/Reports/view/adminhtml/layout/reports_report_review_customer_grid.xml
@@ -53,7 +53,7 @@
                     <argument name="rowUrl" xsi:type="array">
                         <item name="path" xsi:type="string">catalog/product_review</item>
                         <item name="extraParamsTemplate" xsi:type="array">
-                            <item name="customerid" xsi:type="string">getCustomerId</item>
+                            <item name="customerId" xsi:type="string">getCustomerId</item>
                         </item>
                     </argument>
                 </arguments>
diff --git a/app/code/Magento/Review/Block/Adminhtml/Edit.php b/app/code/Magento/Review/Block/Adminhtml/Edit.php
index b2e76e37a571eab38544759db3569b96ff399a59..4320ba58247c6eb35a74f71129a9905546ffaab5 100644
--- a/app/code/Magento/Review/Block/Adminhtml/Edit.php
+++ b/app/code/Magento/Review/Block/Adminhtml/Edit.php
@@ -88,7 +88,7 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container
         if ($prevId !== false) {
             $this->addButton('previous', array(
                 'label' => __('Previous'),
-                'onclick' => 'setLocation(\'' . $this->getUrl('adminhtml/*/*', array('id' => $prevId)) . '\')'
+                'onclick' => 'setLocation(\'' . $this->getUrl('catalog/*/*', array('id' => $prevId)) . '\')'
             ), 3, 10);
 
             $this->addButton('save_and_previous', array(
@@ -130,7 +130,7 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container
 
             $this->addButton('next', array(
                 'label' => __('Next'),
-                'onclick' => 'setLocation(\'' . $this->getUrl('adminhtml/*/*', array('id' => $nextId)) . '\')'
+                'onclick' => 'setLocation(\'' . $this->getUrl('catalog/*/*', array('id' => $nextId)) . '\')'
             ), 3, 105);
         }
         $this->_updateButton('save', 'label', __('Save Review'));
@@ -164,7 +164,7 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container
         }
 
         if ($this->getRequest()->getParam('ret', false) == 'pending') {
-            $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('adminhtml/*/pending') .'\')' );
+            $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getUrl('catalog/*/pending') .'\')' );
             $this->_updateButton(
                 'delete',
                 'onclick',
diff --git a/app/code/Magento/Review/Controller/Product.php b/app/code/Magento/Review/Controller/Product.php
index 2b58a90907c223cb32373bda5e9066fdb6588dcf..d46aa11663499c64d4afc2c00803e88258fc1fa6 100644
--- a/app/code/Magento/Review/Controller/Product.php
+++ b/app/code/Magento/Review/Controller/Product.php
@@ -95,6 +95,11 @@ class Product extends \Magento\App\Action\Action
      */
     protected $_storeManager;
 
+    /**
+     * @var \Magento\Core\App\Action\FormKeyValidator
+     */
+    protected $_formKeyValidator;
+
     /**
      * @param \Magento\App\Action\Context $context
      * @param \Magento\Core\Model\Registry $coreRegistry
@@ -108,6 +113,7 @@ class Product extends \Magento\App\Action\Action
      * @param \Magento\Catalog\Model\Design $catalogDesign
      * @param \Magento\Session\Generic $reviewSession
      * @param \Magento\Core\Model\StoreManagerInterface $storeManager
+     * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
      */
     public function __construct(
         \Magento\App\Action\Context $context,
@@ -121,7 +127,8 @@ class Product extends \Magento\App\Action\Action
         \Magento\Core\Model\Session $session,
         \Magento\Catalog\Model\Design $catalogDesign,
         \Magento\Session\Generic $reviewSession,
-        \Magento\Core\Model\StoreManagerInterface $storeManager
+        \Magento\Core\Model\StoreManagerInterface $storeManager,
+        \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
     ) {
         $this->_storeManager = $storeManager;
         $this->_coreRegistry = $coreRegistry;
@@ -134,6 +141,7 @@ class Product extends \Magento\App\Action\Action
         $this->_ratingFactory = $ratingFactory;
         $this->_session = $session;
         $this->_catalogDesign = $catalogDesign;
+        $this->_formKeyValidator = $formKeyValidator;
 
         parent::__construct($context);
     }
@@ -244,7 +252,10 @@ class Product extends \Magento\App\Action\Action
 
         $review = $this->_reviewFactory->create()->load($reviewId);
         /* @var $review \Magento\Review\Model\Review */
-        if (!$review->getId() || !$review->isApproved() || !$review->isAvailableOnStore($this->_storeManager->getStore())) {
+        if (!$review->getId()
+            || !$review->isApproved()
+            || !$review->isAvailableOnStore($this->_storeManager->getStore())
+        ) {
             return false;
         }
 
@@ -258,6 +269,11 @@ class Product extends \Magento\App\Action\Action
      */
     public function postAction()
     {
+        if (!$this->_formKeyValidator->validate($this->getRequest())) {
+            $this->getResponse()->setRedirect($this->_redirect->getRefererUrl());
+            return;
+        }
+
         $data = $this->_reviewSession->getFormData(true);
         if ($data) {
             $rating = array();
diff --git a/app/code/Magento/Review/view/frontend/customer/list.phtml b/app/code/Magento/Review/view/frontend/customer/list.phtml
index da49143ec62008810a2e5721610545b40fb50e60..fb8a420ceda3ef8802eb6c16fcc7c12e964d84c3 100644
--- a/app/code/Magento/Review/view/frontend/customer/list.phtml
+++ b/app/code/Magento/Review/view/frontend/customer/list.phtml
@@ -27,44 +27,46 @@
     <div class="toolbar reviews">
         <?php echo $this->getToolbarHtml() ?>
     </div>
-    <table class="data table reviews" id="my-reviews-table">
-        <thead>
-            <tr>
-                <th class="col date"><?php echo __('Created') ?></th>
-                <th class="col item"><?php echo __('Product Name') ?></th>
-                <th class="col summary"><?php echo __('Summary') ?></th>
-                <th class="col description"><?php echo __('Description') ?></th>
-                <th class="col actions">&nbsp;</th>
-            </tr>
-        </thead>
-        <tbody>
-            <?php foreach ($this->getCollection() as $_review): ?>
-            <tr>
-                <td class="col date"><?php echo $this->dateFormat($_review->getReviewCreatedAt()); ?></td>
-                <td class="col item">
-                    <strong class="product name">
-                        <a href="<?php echo $this->getProductLink() ?>id/<?php echo $_review->getEntityPkValue() ?>"><?php echo $this->escapeHtml($_review->getName()) ?></a>
-                    </strong>
-                </td>
-                <td class="col summary">
-                <?php if($_review->getSum()): ?>
-                    <div class="rating">
-                        <span style="width:<?php echo ( $_review->getSum() / $_review->getCount() ) ?>%;"></span>
-                    </div>
-                <?php endif; ?>
-                </td>
-                <td class="col description">
-                    <?php echo $this->helper('Magento\Review\Helper\Data')->getDetailHtml($_review->getDetail()) ?>
-                </td>
-                <td class="col actions">
-                    <a href="<?php echo $this->getReviewLink() ?>id/<?php echo $_review->getReviewId() ?>" class="action more">
-                        <span><?php echo __('View Details') ?></span>
-                    </a>
-                </td>
-            </tr>
-            <?php endforeach; ?>
-        </tbody>
-    </table>
+    <div class="wrapper table reviews">
+        <table class="data table reviews" id="my-reviews-table">
+            <thead>
+                <tr>
+                    <th class="col date"><?php echo __('Created') ?></th>
+                    <th class="col item"><?php echo __('Product Name') ?></th>
+                    <th class="col summary"><?php echo __('Summary') ?></th>
+                    <th class="col description"><?php echo __('Description') ?></th>
+                    <th class="col actions">&nbsp;</th>
+                </tr>
+            </thead>
+            <tbody>
+                <?php foreach ($this->getCollection() as $_review): ?>
+                <tr>
+                    <td class="col date"><?php echo $this->dateFormat($_review->getReviewCreatedAt()); ?></td>
+                    <td class="col item">
+                        <strong class="product name">
+                            <a href="<?php echo $this->getProductLink() ?>id/<?php echo $_review->getEntityPkValue() ?>"><?php echo $this->escapeHtml($_review->getName()) ?></a>
+                        </strong>
+                    </td>
+                    <td class="col summary">
+                    <?php if($_review->getSum()): ?>
+                        <div class="rating">
+                            <span style="width:<?php echo ( $_review->getSum() / $_review->getCount() ) ?>%;"></span>
+                        </div>
+                    <?php endif; ?>
+                    </td>
+                    <td class="col description">
+                        <?php echo $this->helper('Magento\Review\Helper\Data')->getDetailHtml($_review->getDetail()) ?>
+                    </td>
+                    <td class="col actions">
+                        <a href="<?php echo $this->getReviewLink() ?>id/<?php echo $_review->getReviewId() ?>" class="action more">
+                            <span><?php echo __('View Details') ?></span>
+                        </a>
+                    </td>
+                </tr>
+                <?php endforeach; ?>
+            </tbody>
+        </table>
+    </div>
     <div class="toolbar reviews bottom">
         <?php echo $this->getToolbarHtml() ?>
     </div>
diff --git a/app/code/Magento/Review/view/frontend/form.phtml b/app/code/Magento/Review/view/frontend/form.phtml
index 16724df55f4d1eb12123b4accac406bfcf0591e0..06e3514a257839025a4a881ad834b5f4779c517a 100644
--- a/app/code/Magento/Review/view/frontend/form.phtml
+++ b/app/code/Magento/Review/view/frontend/form.phtml
@@ -28,6 +28,7 @@
 <div class="content">
 <?php if ($this->getAllowWriteReviewFlag()): ?>
 <form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
+    <?php echo $this->getBlockHtml('formkey'); ?>
     <?php echo $this->getChildHtml('form_fields_before')?>
     <fieldset class="fieldset" data-hasrequired="<?php __('* Required Fields'); ?>">
         <legend class="legend"><span><?php echo __("You're reviewing:"); ?></span><strong><?php echo $this->escapeHtml($this->getProductInfo()->getName()) ?></strong></legend><br />
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus.php
index 8d011a64868f9217f573eaa9a43bed631b6b154d..4d207c6a0317c4530e1b7c3b087437b2271322f6 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus.php
@@ -33,7 +33,8 @@ class NewStatus extends \Magento\Backend\Block\Widget\Form\Container
     {
         $this->_objectId = 'status';
         $this->_controller = 'adminhtml_order_status';
-        $this->_mode = 'new';
+        $this->_blockGroup = 'Magento_Sales';
+        $this->_mode = 'newStatus';
 
         parent::_construct();
         $this->_updateButton('save', 'label', __('Save Status'));
diff --git a/app/code/Magento/Sales/Controller/Billing/Agreement.php b/app/code/Magento/Sales/Controller/Billing/Agreement.php
index aa7b044629e02aa7f60486e77aa82bd2cbd3218e..5cdbc395d976f170a574148b8b167cf312f0db01 100644
--- a/app/code/Magento/Sales/Controller/Billing/Agreement.php
+++ b/app/code/Magento/Sales/Controller/Billing/Agreement.php
@@ -29,7 +29,6 @@
  */
 namespace Magento\Sales\Controller\Billing;
 
-use Magento\App\Action\NotFoundException;
 use Magento\App\RequestInterface;
 
 class Agreement extends \Magento\App\Action\Action
@@ -188,7 +187,10 @@ class Agreement extends \Magento\App\Action\Action
     public function cancelAction()
     {
         $agreement = $this->_initAgreement();
-        if ($agreement && $agreement->canCancel()) {
+        if (!$agreement) {
+            return;
+        }
+        if ($agreement->canCancel()) {
             try {
                 $agreement->cancel();
                 $this->messageManager->addNotice(
@@ -207,22 +209,25 @@ class Agreement extends \Magento\App\Action\Action
     /**
      * Init billing agreement model from request
      *
-     * @return \Magento\Sales\Model\Billing\Agreement
+     * @return \Magento\Sales\Model\Billing\Agreement|bool
      */
     protected function _initAgreement()
     {
         $agreementId = $this->getRequest()->getParam('agreement');
         if ($agreementId) {
+            /** @var \Magento\Sales\Model\Billing\Agreement $billingAgreement */
             $billingAgreement = $this->_objectManager->create('Magento\Sales\Model\Billing\Agreement')
                 ->load($agreementId);
-            if (!$billingAgreement->getAgreementId()) {
-                $this->messageManager->addError(__('Please specify the correct billing agreement ID and try again.'));
-                $this->_redirect('*/*/');
-                return false;
+            $currentCustomerId = $this->_getSession()->getCustomerId();
+            $agreementCustomerId = $billingAgreement->getCustomerId();
+            if ($billingAgreement->getId() && $agreementCustomerId == $currentCustomerId) {
+                $this->_coreRegistry->register('current_billing_agreement', $billingAgreement);
+                return $billingAgreement;
             }
         }
-        $this->_coreRegistry->register('current_billing_agreement', $billingAgreement);
-        return $billingAgreement;
+        $this->messageManager->addError(__('Please specify the correct billing agreement ID and try again.'));
+        $this->_redirect('*/*/');
+        return false;
     }
 
     /**
diff --git a/app/code/Magento/Sales/Model/Billing/Agreement.php b/app/code/Magento/Sales/Model/Billing/Agreement.php
index 735197093bd58f7a91e1b98bbe77a8cbe8b2041c..8cca0d6b98abade93d5b84b52659c61321b072e5 100644
--- a/app/code/Magento/Sales/Model/Billing/Agreement.php
+++ b/app/code/Magento/Sales/Model/Billing/Agreement.php
@@ -24,6 +24,8 @@
  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
  */
 
+namespace Magento\Sales\Model\Billing;
+
 /**
  * Billing Agreement abstract model
  *
@@ -46,8 +48,6 @@
  * @method string getAgreementLabel()
  * @method \Magento\Sales\Model\Billing\Agreement setAgreementLabel(string $value)
  */
-namespace Magento\Sales\Model\Billing;
-
 class Agreement extends \Magento\Payment\Model\Billing\AbstractAgreement
 {
     const STATUS_ACTIVE     = 'active';
diff --git a/app/code/Magento/Sales/Model/Quote/Address.php b/app/code/Magento/Sales/Model/Quote/Address.php
index 872e7d1d5ac9952c82c56e480ad39d00539703af..476688064f38f414f41d52030341c63fdfdff243 100644
--- a/app/code/Magento/Sales/Model/Quote/Address.php
+++ b/app/code/Magento/Sales/Model/Quote/Address.php
@@ -336,27 +336,66 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress
     protected function _beforeSave()
     {
         parent::_beforeSave();
+        $this->_populateBeforeSaveData();
+        return $this;
+    }
+
+    /**
+     * Set the required fields
+     */
+    protected function _populateBeforeSaveData()
+    {
         if ($this->getQuote()) {
-            $quoteId = $this->getQuote()->getId();
-            if ($quoteId) {
-                $this->setQuoteId($quoteId);
-            } else {
-                $this->_dataSaveAllowed = false;
+            $this->_dataSaveAllowed = (bool)$this->getQuote()->getId();
+
+            if ($this->getQuote()->getId()) {
+                $this->setQuoteId($this->getQuote()->getId());
             }
             $this->setCustomerId($this->getQuote()->getCustomerId());
+
             /**
              * Init customer address id if customer address is assigned
              */
             if ($this->getCustomerAddress()) {
                 $this->setCustomerAddressId($this->getCustomerAddress()->getId());
             }
+
+            $this->setSameAsBilling((int)$this->_isSameAsBilling());
         }
-        if ($this->getAddressType() == \Magento\Sales\Model\Quote\Address::TYPE_SHIPPING
-            && $this->getSameAsBilling() === null
-        ) {
-            $this->setSameAsBilling(1);
-        }
-        return $this;
+    }
+
+    /**
+     * Returns true if shipping address is same as billing
+     *
+     * @return bool
+     */
+    protected function _isSameAsBilling()
+    {
+        return $this->getAddressType() == \Magento\Sales\Model\Quote\Address::TYPE_SHIPPING
+            && ($this->_isNotRegisteredCustomer() || $this->_isDefaultShippingNullOrSameAsBillingAddress());
+    }
+
+    /**
+     * Checks if the user is a registered customer
+     *
+     * @return bool
+     */
+    protected function _isNotRegisteredCustomer()
+    {
+        return !$this->getQuote()->getCustomerId() || $this->getCustomerAddressId() === null;
+    }
+
+    /**
+     * Returns true if shipping address is same as billing or it is undefined
+     *
+     * @return bool
+     */
+    protected function _isDefaultShippingNullOrSameAsBillingAddress()
+    {
+        $customer = $this->getQuote()->getCustomer();
+        return !$customer->getDefaultShippingAddress()
+            || $customer->getDefaultBillingAddress() && $customer->getDefaultShippingAddress()
+                && $customer->getDefaultBillingAddress()->getId() == $customer->getDefaultShippingAddress()->getId();
     }
 
     /**
diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_newstatus.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_new.xml
similarity index 100%
rename from app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_newstatus.xml
rename to app/code/Magento/Sales/view/adminhtml/layout/sales_order_status_new.xml
diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/giftmessage.js b/app/code/Magento/Sales/view/adminhtml/order/create/giftmessage.js
index 03799a9fb7f1e7a63fbb72115c873a6e544063d9..20194784923247d1b24182f6cdf6c13f99e6d3ff 100644
--- a/app/code/Magento/Sales/view/adminhtml/order/create/giftmessage.js
+++ b/app/code/Magento/Sales/view/adminhtml/order/create/giftmessage.js
@@ -244,7 +244,7 @@ GiftMessageSet.prototype = {
                 }
             }, this);
             $('gift_options_giftmessage').show();
-        } else {
+        } else if ($('gift_options_giftmessage')) {
             $('gift_options_giftmessage').hide();
         }
 
diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/totals/default.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/totals/default.phtml
index 34454da994a99a594b37fbaf1c2fdf5b1448763c..1cda86be4cda17871735ea3d4cea439a4db088cf 100644
--- a/app/code/Magento/Sales/view/adminhtml/order/create/totals/default.phtml
+++ b/app/code/Magento/Sales/view/adminhtml/order/create/totals/default.phtml
@@ -24,7 +24,7 @@
  * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
  */
 ?>
-<tr class="<?php echo $this->getTotal()->getCode(); ?>">
+<tr class="<?php echo $this->getTotal()->getCode(); ?> row-totals">
     <td style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
         <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><strong><?php endif; ?>
             <?php echo $this->escapeHtml($this->getTotal()->getTitle()); ?>
diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/totals/grandtotal.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/totals/grandtotal.phtml
index 64d82936474c04163dac3261634bb7b6da0d78f3..87c40cb6bf49c443d31ccc0261b9f6db5946383c 100644
--- a/app/code/Magento/Sales/view/adminhtml/order/create/totals/grandtotal.phtml
+++ b/app/code/Magento/Sales/view/adminhtml/order/create/totals/grandtotal.phtml
@@ -29,7 +29,7 @@
  */
 ?>
 <?php if ($this->includeTax() && $this->getTotalExclTax()>=0):?>
-<tr>
+<tr class="row-totals">
     <td style="<?php echo $this->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
         <strong><?php echo __('Grand Total Excl. Tax')?></strong>
     </td>
@@ -38,7 +38,7 @@
     </td>
 </tr>
 <?php echo $this->renderTotals('taxes', $this->getColspan()); ?>
-<tr>
+<tr class="row-totals">
     <td style="<?php echo $this->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
         <strong><?php echo __('Grand Total Incl. Tax')?></strong>
     </td>
@@ -47,7 +47,7 @@
     </td>
 </tr>
 <?php else:?>
-<tr>
+<tr class="row-totals">
     <td style="<?php echo $this->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
         <strong><?php echo $this->getTotal()->getTitle() ?></strong>
     </td>
diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/totals/shipping.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/totals/shipping.phtml
index cc9e7fbd967a1ed24a747233666112f667e6d2fc..49fc7be161fe9cbac3f32b05de93f9bc1dd65bc7 100644
--- a/app/code/Magento/Sales/view/adminhtml/order/create/totals/shipping.phtml
+++ b/app/code/Magento/Sales/view/adminhtml/order/create/totals/shipping.phtml
@@ -29,7 +29,7 @@
  */
 ?>
 <?php if ($this->displayBoth()):?>
-<tr>
+<tr class="row-totals">
     <td style="<?php echo $this->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
         <?php echo $this->getExcludeTaxLabel() ?>
     </td>
@@ -37,7 +37,7 @@
         <?php echo $this->formatPrice($this->getShippingExcludeTax()) ?>
     </td>
 </tr>
-<tr>
+<tr class="row-totals">
     <td style="<?php echo $this->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
         <?php echo $this->getIncludeTaxLabel() ?>
     </td>
@@ -55,7 +55,7 @@
     </td>
 </tr>
 <?php else:?>
-<tr>
+<tr class="row-totals">
     <td style="<?php echo $this->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
         <?php echo $this->escapeHtml($this->getTotal()->getTitle()) ?>
     </td>
diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/totals/subtotal.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/totals/subtotal.phtml
index f3c14a65b90330ab6006c98d27699fcce8624671..c0e89a9b7036ecf548e9ef58746ada71c9c47e40 100644
--- a/app/code/Magento/Sales/view/adminhtml/order/create/totals/subtotal.phtml
+++ b/app/code/Magento/Sales/view/adminhtml/order/create/totals/subtotal.phtml
@@ -29,7 +29,7 @@
  */
 ?>
 <?php if ($this->displayBoth()):?>
-<tr>
+<tr class="row-totals">
     <td style="<?php echo $this->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
         <?php echo __('Subtotal (Excl. Tax)') ?>
     </td>
@@ -37,7 +37,7 @@
         <?php echo $this->formatPrice($this->getTotal()->getValueExclTax()) ?>
     </td>
 </tr>
-<tr>
+<tr class="row-totals">
     <td style="<?php echo $this->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
         <?php echo __('Subtotal (Incl. Tax)') ?>
     </td>
@@ -46,7 +46,7 @@
     </td>
 </tr>
 <?php else : ?>
-<tr>
+<tr class="row-totals">
     <td style="<?php echo $this->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
         <?php echo $this->getTotal()->getTitle() ?>
     </td>
diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/totals/tax.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/totals/tax.phtml
index 157b7c3094a57ecbcf70e04a83a41dac5f00f130..598bbc1e13c14d2f4af1f4c541028b1d52b99390 100644
--- a/app/code/Magento/Sales/view/adminhtml/order/create/totals/tax.phtml
+++ b/app/code/Magento/Sales/view/adminhtml/order/create/totals/tax.phtml
@@ -55,7 +55,7 @@
             <?php endforeach; ?>
 <?php endif;?>
 <?php $class="{$this->getTotal()->getCode()} " . ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary() ? 'summary-total' : ''); ?>
-<tr<?php if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary()): ?> onclick="expandDetails(this, '.summary-details-<?php echo $taxIter;?>')"<?php endif; ?> class="<?php echo $class;?>">
+<tr<?php if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary()): ?> onclick="expandDetails(this, '.summary-details-<?php echo $taxIter;?>')"<?php endif; ?> class="<?php echo $class;?> row-totals">
     <td style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>">
         <?php if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary()): ?>
             <div class="summary-collapse"><?php echo $this->getTotal()->getTitle() ?></div>
diff --git a/app/code/Magento/Sales/view/adminhtml/order/invoice/view/form.phtml b/app/code/Magento/Sales/view/adminhtml/order/invoice/view/form.phtml
index a28086aac85ea5ff6b65f9046d53e682770c548a..f229e7fa1407fa51f0afb820887714cd399b80f4 100644
--- a/app/code/Magento/Sales/view/adminhtml/order/invoice/view/form.phtml
+++ b/app/code/Magento/Sales/view/adminhtml/order/invoice/view/form.phtml
@@ -28,9 +28,12 @@
 <?php $_order = $_invoice->getOrder() ?>
 <?php echo $this->getChildHtml('order_info') ?>
 
+<?php /* opening div is in app\code\Magento\Sales\view\adminhtml\order\view\info.phtml */?>
+
 <?php if (!$_order->getIsVirtual()): ?>
-<div class="clearfix">
+<div class="clearfix"> <?php /* if opening div from app\code\Magento\Sales\view\adminhtml\order\view\info.phtml was closed there */?>
 <?php endif; ?>
+
     <div class="order-payment-method<?php if ($_order->getIsVirtual()): ?> order-payment-method-virtual<?php endif; ?>">
         <?php /*Billing Address */ ?>
         <div class="fieldset-wrapper">
@@ -41,6 +44,7 @@
             <div class="order-payment-currency"><?php echo __('The order was placed using %1.', $_order->getOrderCurrencyCode()) ?></div>
         </div>
     </div>
+
     <?php if (!$_order->getIsVirtual()): ?>
     <div class="order-shipping-address">
         <?php /*Shipping Address */ ?>
@@ -68,20 +72,22 @@
                 </div>
             </div>
         </div>
-    <?php endif; ?>
     </div>
+    <?php endif; ?>
+
 </div>
 
 <div class="fieldset-wrapper">
     <div class="fieldset-wrapper-title">
         <span class="title"><?php echo __('Items Invoiced') ?></span>
     </div>
+
     <div id="invoice_item_container">
         <?php echo $this->getChildHtml('invoice_items') ?>
     </div>
 </div>
 
-<div class="clear">
+<div class="clearfix">
     <div class="order-comments-history">
         <div class="fieldset-wrapper">
             <div class="fieldset-wrapper-title">
@@ -92,6 +98,7 @@
             </fieldset>
         </div>
     </div>
+
     <div class="order-totals">
         <div class="fieldset-wrapper" id="history_form">
             <div class="fieldset-wrapper-title">
diff --git a/app/code/Magento/Sales/view/adminhtml/order/shipment/packaging.js b/app/code/Magento/Sales/view/adminhtml/order/shipment/packaging.js
index 93a447ee8b5857f78be60fad1d1a8847b617d24f..e863c29b5a36ae28b1ea2f4179d657f5f8a114f3 100644
--- a/app/code/Magento/Sales/view/adminhtml/order/shipment/packaging.js
+++ b/app/code/Magento/Sales/view/adminhtml/order/shipment/packaging.js
@@ -141,7 +141,7 @@ Packaging.prototype = {
                 height = parseFloat(pack.select('input[name="container_height"]')[0].value);
                 packagesParams[packageId] = {
                     container:                  pack.select('select[name="package_container"]')[0].value,
-                    customs_value:              parseInt(pack.select('input[name="package_customs_value"]')[0].value, 10),
+                    customs_value:              parseFloat(pack.select('input[name="package_customs_value"]')[0].value, 10),
                     weight:                     isNaN(weight) ? '' : weight,
                     length:                     isNaN(length) ? '' : length,
                     width:                      isNaN(width) ? '' : width,
diff --git a/app/code/Magento/Sales/view/adminhtml/order/view/info.phtml b/app/code/Magento/Sales/view/adminhtml/order/view/info.phtml
index ab5b01810f38138b886864f54f24b6b1200939cd..06c78a73072f921c48b4ab9a3f879472a8fc733a 100644
--- a/app/code/Magento/Sales/view/adminhtml/order/view/info.phtml
+++ b/app/code/Magento/Sales/view/adminhtml/order/view/info.phtml
@@ -30,7 +30,11 @@
 $orderAdminDate = $this->formatDate($_order->getCreatedAtDate(), 'medium', true);
 $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium', true);
 ?>
+
+<?php /* the opening and closing divs of these two clearfixes are in app\code\core\Mage\Adminhtml\view\adminhtml\sales\order\invoice\create\form.phtml */?>
+
 <div class="clearfix">
+
     <div class="order-information">
         <?php /* Order Information */?>
         <div class="fieldset-wrapper">
@@ -107,6 +111,7 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium',
             </table>
         </div>
     </div>
+
     <div class="order-account-information">
         <?php /* Account Information */?>
         <div class="fieldset-wrapper">
@@ -144,10 +149,11 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium',
             </table>
         </div>
     </div>
-<?php /* the opening and closing divs of these two clearfixes are in app\code\core\Mage\Adminhtml\view\adminhtml\sales\order\invoice\create\form.phtml */?>
+
 </div>
 
 <div class="clearfix">
+
     <div class="order-billing-address">
         <?php /* Billing Address */?>
         <div class="fieldset-wrapper">
@@ -160,6 +166,7 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium',
             <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
         </div>
     </div>
+
     <?php if (!$this->getOrder()->getIsVirtual()): ?>
     <div class="order-shipping-address">
         <?php /* Shipping Address */ ?>
@@ -175,3 +182,5 @@ $orderStoreDate = $this->formatDate($_order->getCreatedAtStoreDate(), 'medium',
     </div>
 </div>
     <?php endif; ?>
+
+<?php /* closing div of this opening div are in app\code\Magento\Sales\view\adminhtml\order\invoice\view\form.phtml */?>
diff --git a/app/code/Magento/Sales/view/frontend/billing/agreement/view.phtml b/app/code/Magento/Sales/view/frontend/billing/agreement/view.phtml
index f352e60e34c244bfcb2033f8720c4a11aa1c0671..0cfe03596a696162ce8aa46c7c26a1a639ce6adf 100644
--- a/app/code/Magento/Sales/view/frontend/billing/agreement/view.phtml
+++ b/app/code/Magento/Sales/view/frontend/billing/agreement/view.phtml
@@ -35,31 +35,32 @@
     </div>
     <div class="content">
         <h2 class="subtitle caption"><?php echo __('Agreement Information') ?></h2>
-        <table class="data table">
-            <thead>
-                <tr>
-                    <th class="col id"><?php echo __('Reference ID:'); ?></th>
-                    <th class="col status"><?php echo __('Status:'); ?></th>
-                    <th class="col created"><?php echo __('Created:'); ?></th>
-                    <?php if($this->getAgreementUpdatedAt()): ?>
-                        <th class="col updated"><?php echo __('Updated:'); ?></th>
-                    <?php endif; ?>
-                    <th class="col payment"><?php echo __('Payment Method:'); ?></th>
-                </tr>
-            </thead>
-            <tbody>
-                <tr>
-                    <td class="col id"><?php echo $this->escapeHtml($this->getReferenceId()); ?></td>
-                    <td class="col status"><?php echo $this->getAgreementStatus() ?></td>
-                    <td class="col created"><?php echo $this->escapeHtml($this->getAgreementCreatedAt()) ?></td>
-                    <?php if($this->getAgreementUpdatedAt()): ?>
-                        <td class="col updated"><?php echo $this->escapeHtml($this->getAgreementUpdatedAt()); ?></td>
-                    <?php endif; ?>
-                    <td class="col payment"><?php echo $this->getPaymentMethodTitle() ?></td>
-                </tr>
-            </tbody>
-        </table>
-
+        <div class="wrapper table billing agreements">
+            <table class="data table">
+                <thead>
+                    <tr>
+                        <th class="col id"><?php echo __('Reference ID:'); ?></th>
+                        <th class="col status"><?php echo __('Status:'); ?></th>
+                        <th class="col created"><?php echo __('Created:'); ?></th>
+                        <?php if($this->getAgreementUpdatedAt()): ?>
+                            <th class="col updated"><?php echo __('Updated:'); ?></th>
+                        <?php endif; ?>
+                        <th class="col payment"><?php echo __('Payment Method:'); ?></th>
+                    </tr>
+                </thead>
+                <tbody>
+                    <tr>
+                        <td class="col id"><?php echo $this->escapeHtml($this->getReferenceId()); ?></td>
+                        <td class="col status"><?php echo $this->getAgreementStatus() ?></td>
+                        <td class="col created"><?php echo $this->escapeHtml($this->getAgreementCreatedAt()) ?></td>
+                        <?php if($this->getAgreementUpdatedAt()): ?>
+                            <td class="col updated"><?php echo $this->escapeHtml($this->getAgreementUpdatedAt()); ?></td>
+                        <?php endif; ?>
+                        <td class="col payment"><?php echo $this->getPaymentMethodTitle() ?></td>
+                    </tr>
+                </tbody>
+            </table>
+        </div>
         <?php $relatedOrders = $this->getRelatedOrders() ?>
         <?php if(count($relatedOrders) > 0): ?>
         <?php echo $this->getChildHtml('pager'); ?>
diff --git a/app/code/Magento/Sales/view/frontend/billing/agreements.phtml b/app/code/Magento/Sales/view/frontend/billing/agreements.phtml
index e2efcb4217b2d16b540a4efaf330fd425b79d026..356935219fb0f0ab2189bbf34ab7346ca8ab1417 100644
--- a/app/code/Magento/Sales/view/frontend/billing/agreements.phtml
+++ b/app/code/Magento/Sales/view/frontend/billing/agreements.phtml
@@ -27,32 +27,34 @@
     <?php $billingAgreements = $this->getBillingAgreements(); ?>
     <?php if (count($billingAgreements) > 0): ?>
         <?php echo $this->getChildHtml('pager'); ?>
-        <table id="billing-agreements" class="data table billing agreements">
-            <thead>
-            <tr>
-                <th class="col id"><?php echo __('Reference ID'); ?></th>
-                <th class="col status"><?php echo __('Status'); ?></th>
-                <th class="col created"><?php echo __('Created At'); ?></th>
-                <th class="col updated"><?php echo __('Updated At'); ?></th>
-                <th class="col payment"><?php echo __('Payment Method'); ?></th>
-                <th class="col actions">&nbsp;</th>
-            </tr>
-            </thead>
-            <tbody>
-            <?php foreach ($billingAgreements as $item): ?>
+        <div class="wrapper table billing agreements">
+            <table id="billing-agreements" class="data table billing agreements">
+                <thead>
                 <tr>
-                    <td class="col id"><?php echo $this->getItemValue($item, 'reference_id') ?></td>
-                    <td class="col status"><?php echo $this->getItemValue($item, 'status') ?></td>
-                    <td class="col created"><?php echo $this->getItemValue($item, 'created_at') ?></td>
-                    <td class="col updated"><?php echo $this->getItemValue($item, 'updated_at') ?></td>
-                    <td class="col payment"><?php echo $this->getItemValue($item, 'payment_method_label') ?></td>
-                    <td class="col actions">
-                        <a href="<?php echo $this->getItemValue($item, 'edit_url') ?>"><?php echo __('View') ?></a>
-                    </td>
+                    <th class="col id"><?php echo __('Reference ID'); ?></th>
+                    <th class="col status"><?php echo __('Status'); ?></th>
+                    <th class="col created"><?php echo __('Created At'); ?></th>
+                    <th class="col updated"><?php echo __('Updated At'); ?></th>
+                    <th class="col payment"><?php echo __('Payment Method'); ?></th>
+                    <th class="col actions">&nbsp;</th>
                 </tr>
-            <?php endforeach; ?>
-            </tbody>
-        </table>
+                </thead>
+                <tbody>
+                <?php foreach ($billingAgreements as $item): ?>
+                    <tr>
+                        <td class="col id"><?php echo $this->getItemValue($item, 'reference_id') ?></td>
+                        <td class="col status"><?php echo $this->getItemValue($item, 'status') ?></td>
+                        <td class="col created"><?php echo $this->getItemValue($item, 'created_at') ?></td>
+                        <td class="col updated"><?php echo $this->getItemValue($item, 'updated_at') ?></td>
+                        <td class="col payment"><?php echo $this->getItemValue($item, 'payment_method_label') ?></td>
+                        <td class="col actions">
+                            <a href="<?php echo $this->getItemValue($item, 'edit_url') ?>"><?php echo __('View') ?></a>
+                        </td>
+                    </tr>
+                <?php endforeach; ?>
+                </tbody>
+            </table>
+        </div>
     <?php else: ?>
         <div class="message info empty"><span><?php echo __('There are no billing agreements yet.') ?></span></div>
     <?php endif; ?>
diff --git a/app/code/Magento/Sales/view/frontend/order/creditmemo/items.phtml b/app/code/Magento/Sales/view/frontend/order/creditmemo/items.phtml
index 5c3d8d85590371d2c9b64fb24c68579572cdcae4..575e3c0912acf5390669dee95dc60f88f44c1941 100644
--- a/app/code/Magento/Sales/view/frontend/order/creditmemo/items.phtml
+++ b/app/code/Magento/Sales/view/frontend/order/creditmemo/items.phtml
@@ -44,29 +44,31 @@
 </div>
 
 <div class="order subtitle caption"><strong><?php echo __('Items Refunded') ?></strong></div>
-<table class="data table order items creditmemo" id="my-refund-table-<?php echo $_creditmemo->getId(); ?>">
-    <thead>
-        <tr>
-            <th class="col name"><?php echo __('Product Name') ?></th>
-            <th class="col sku"><?php echo __('SKU') ?></th>
-            <th class="col price"><?php echo __('Price') ?></th>
-            <th class="col qty"><?php echo __('Qty') ?></th>
-            <th class="col subtotal"><?php echo __('Subtotal') ?></th>
-            <th class="col discount"><?php echo __('Discount Amount') ?></th>
-            <th class="col total"><?php echo __('Row Total') ?></th>
-        </tr>
-    </thead>
-    <tfoot>
-       <?php echo $this->getTotalsHtml($_creditmemo);?>
-    </tfoot>
-    <?php $_items = $_creditmemo->getAllItems(); ?>
-    <?php $_count = count($_items) ?>
-    <?php foreach ($_items as $_item): ?>
-    <?php if ($_item->getOrderItem()->getParentItem()) continue; ?>
-    <tbody>
-        <?php echo $this->getItemHtml($_item) ?>
-    </tbody>
-    <?php endforeach; ?>
-</table>
+<div class="wrapper table order items creditmemo">
+    <table class="data table order items creditmemo" id="my-refund-table-<?php echo $_creditmemo->getId(); ?>">
+        <thead>
+            <tr>
+                <th class="col name"><?php echo __('Product Name') ?></th>
+                <th class="col sku"><?php echo __('SKU') ?></th>
+                <th class="col price"><?php echo __('Price') ?></th>
+                <th class="col qty"><?php echo __('Qty') ?></th>
+                <th class="col subtotal"><?php echo __('Subtotal') ?></th>
+                <th class="col discount"><?php echo __('Discount Amount') ?></th>
+                <th class="col total"><?php echo __('Row Total') ?></th>
+            </tr>
+        </thead>
+        <tfoot>
+           <?php echo $this->getTotalsHtml($_creditmemo);?>
+        </tfoot>
+        <?php $_items = $_creditmemo->getAllItems(); ?>
+        <?php $_count = count($_items) ?>
+        <?php foreach ($_items as $_item): ?>
+        <?php if ($_item->getOrderItem()->getParentItem()) continue; ?>
+        <tbody>
+            <?php echo $this->getItemHtml($_item) ?>
+        </tbody>
+        <?php endforeach; ?>
+    </table>
+</div>
 <?php echo $this->getCommentsHtml($_creditmemo)?>
 <?php endforeach; ?>
diff --git a/app/code/Magento/Sales/view/frontend/order/history.phtml b/app/code/Magento/Sales/view/frontend/order/history.phtml
index 86ea2fcf963a314e8d42b271a01fc2c6ef59839f..0160af2e5e7b44f5b6cfea7959ddbf4540e9520b 100644
--- a/app/code/Magento/Sales/view/frontend/order/history.phtml
+++ b/app/code/Magento/Sales/view/frontend/order/history.phtml
@@ -27,39 +27,41 @@
 <?php echo $this->getChildHtml('info');?>
 <div class="order toolbar"><?php echo $this->getPagerHtml(); ?></div>
 <?php if($_orders->getSize()): ?>
-<table class="data table orders history" id="my-orders-table">
-    <thead>
-        <tr>
-            <th class="col id"><?php echo __('Order #') ?></th>
-            <th class="col date"><?php echo __('Date') ?></th>
-            <th class="col shipping"><?php echo __('Ship To') ?></th>
-            <th class="col total"><?php echo __('Order Total') ?></th>
-            <th class="col status"><?php echo __('Status') ?></th>
-            <th class="col actions">&nbsp;</th>
-        </tr>
-    </thead>
-    <tbody>
-        <?php foreach ($_orders as $_order): ?>
+<div class="wrapper table orders history">
+    <table class="data table orders history" id="my-orders-table">
+        <thead>
             <tr>
-                <td class="col id"><?php echo $_order->getRealOrderId() ?></td>
-                <td class="col date"><?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?></td>
-                <td class="col shipping"><?php echo $_order->getShippingAddress() ? $this->escapeHtml($_order->getShippingAddress()->getName()) : '&nbsp;' ?></td>
-                <td class="col total"><?php echo $_order->formatPrice($_order->getGrandTotal()) ?></td>
-                <td class="col status"><em><?php echo $_order->getStatusLabel() ?></em></td>
-                <td class="col actions">
-                    <a href="<?php echo $this->getViewUrl($_order) ?>" class="action view">
-                        <span><?php echo __('View Order') ?></span>
-                    </a>
-                    <?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order)) : ?>
-                        <a href="<?php echo $this->getReorderUrl($_order) ?>" class="action order">
-                            <span><?php echo __('Reorder') ?></span>
-                        </a>
-                    <?php endif ?>
-                </td>
+                <th class="col id"><?php echo __('Order #') ?></th>
+                <th class="col date"><?php echo __('Date') ?></th>
+                <th class="col shipping"><?php echo __('Ship To') ?></th>
+                <th class="col total"><?php echo __('Order Total') ?></th>
+                <th class="col status"><?php echo __('Status') ?></th>
+                <th class="col actions">&nbsp;</th>
             </tr>
-        <?php endforeach; ?>
-    </tbody>
-</table>
+        </thead>
+        <tbody>
+            <?php foreach ($_orders as $_order): ?>
+                <tr>
+                    <td class="col id"><?php echo $_order->getRealOrderId() ?></td>
+                    <td class="col date"><?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?></td>
+                    <td class="col shipping"><?php echo $_order->getShippingAddress() ? $this->escapeHtml($_order->getShippingAddress()->getName()) : '&nbsp;' ?></td>
+                    <td class="col total"><?php echo $_order->formatPrice($_order->getGrandTotal()) ?></td>
+                    <td class="col status"><em><?php echo $_order->getStatusLabel() ?></em></td>
+                    <td class="col actions">
+                        <a href="<?php echo $this->getViewUrl($_order) ?>" class="action view">
+                            <span><?php echo __('View Order') ?></span>
+                        </a>
+                        <?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order)) : ?>
+                            <a href="<?php echo $this->getReorderUrl($_order) ?>" class="action order">
+                                <span><?php echo __('Reorder') ?></span>
+                            </a>
+                        <?php endif ?>
+                    </td>
+                </tr>
+            <?php endforeach; ?>
+        </tbody>
+    </table>
+</div>
 <div class="order toolbar bottom"><?php echo $this->getPagerHtml(); ?></div>
 <?php else: ?>
     <div class="message info empty"><span><?php echo __('You have placed no orders.'); ?></span></div>
diff --git a/app/code/Magento/Sales/view/frontend/order/invoice/items.phtml b/app/code/Magento/Sales/view/frontend/order/invoice/items.phtml
index b9be6d9379d45222cfd2bce13c4578b6f5dd5d81..f4533843c7c3d2a3b410c40f771572ca9f680168 100644
--- a/app/code/Magento/Sales/view/frontend/order/invoice/items.phtml
+++ b/app/code/Magento/Sales/view/frontend/order/invoice/items.phtml
@@ -43,27 +43,29 @@
     </a>
 </div>
 <div class="order subtitle caption"><strong><?php echo __('Items Invoiced') ?></strong></div>
-<table class="data table order items invoice" id="my-invoice-table-<?php echo $_invoice->getId(); ?>">
-    <thead>
-        <tr>
-            <th class="col name"><?php echo __('Product Name') ?></th>
-            <th class="col sku"><?php echo __('SKU') ?></th>
-            <th class="col price"><?php echo __('Price') ?></th>
-            <th class="col qty"><?php echo __('Qty Invoiced') ?></th>
-            <th class="col subtotal"><?php echo __('Subtotal') ?></th>
-        </tr>
-    </thead>
-    <tfoot>
-        <?php echo $this->getInvoiceTotalsHtml($_invoice)?>
-    </tfoot>
-    <?php $_items = $_invoice->getAllItems(); ?>
-    <?php $_count = count($_items) ?>
-    <?php foreach ($_items as $_item): ?>
-    <?php if ($_item->getOrderItem()->getParentItem()) continue; ?>
-    <tbody>
-        <?php echo $this->getItemHtml($_item) ?>
-    </tbody>
-    <?php endforeach; ?>
-</table>
+<div class="wrapper table order items invoice">
+    <table class="data table order items invoice" id="my-invoice-table-<?php echo $_invoice->getId(); ?>">
+        <thead>
+            <tr>
+                <th class="col name"><?php echo __('Product Name') ?></th>
+                <th class="col sku"><?php echo __('SKU') ?></th>
+                <th class="col price"><?php echo __('Price') ?></th>
+                <th class="col qty"><?php echo __('Qty Invoiced') ?></th>
+                <th class="col subtotal"><?php echo __('Subtotal') ?></th>
+            </tr>
+        </thead>
+        <tfoot>
+            <?php echo $this->getInvoiceTotalsHtml($_invoice)?>
+        </tfoot>
+        <?php $_items = $_invoice->getAllItems(); ?>
+        <?php $_count = count($_items) ?>
+        <?php foreach ($_items as $_item): ?>
+        <?php if ($_item->getOrderItem()->getParentItem()) continue; ?>
+        <tbody>
+            <?php echo $this->getItemHtml($_item) ?>
+        </tbody>
+        <?php endforeach; ?>
+    </table>
+</div>
 <?php echo $this->getInvoiceCommentsHtml($_invoice)?>
 <?php endforeach; ?>
diff --git a/app/code/Magento/Sales/view/frontend/order/items.phtml b/app/code/Magento/Sales/view/frontend/order/items.phtml
index 0ab62e2dc0779e477663533fd9f582a8e2258e8a..807929dba4a6f8d75d95ca170c1d6c381253df63 100644
--- a/app/code/Magento/Sales/view/frontend/order/items.phtml
+++ b/app/code/Magento/Sales/view/frontend/order/items.phtml
@@ -25,51 +25,53 @@
 ?>
 <?php $_order = $this->getOrder() ?>
 <?php $_giftMessage; ?>
-<table class="data table order items" id="my-orders-table" summary="<?php echo __('Items Ordered') ?>">
-    <thead>
-        <tr>
-            <th class="col name"><?php echo __('Product Name') ?></th>
-            <th class="col sku"><?php echo __('SKU') ?></th>
-            <th class="col price"><?php echo __('Price') ?></th>
-            <th class="col qty"><?php echo __('Qty') ?></th>
-            <th class="col subtotal"><?php echo __('Subtotal') ?></th>
-        </tr>
-    </thead>
-    <tfoot>
-        <?php echo $this->getChildHtml('order_totals') ?>
-    </tfoot>
-        <?php $_items = $_order->getItemsCollection(); ?>
-        <?php $_index = 0; ?>
-        <?php $_count = $_items->count(); ?>
-        <?php $_giftMessage = ''?>
-        <?php foreach ($_items as $_item): ?>
-        <?php if ($_item->getParentItem()) continue; ?>
-        <tbody>
-            <?php echo $this->getItemHtml($_item) ?>
-            <?php if ($this->helper('Magento\GiftMessage\Helper\Message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?>
-            <tr id="order-item-gift-message-<?php echo $_item->getId() ?>" role="region" aria-expanded="false" tabindex="-1" style="display:none;">
-                <?php $_giftMessage = $this->helper('Magento\GiftMessage\Helper\Message')->getGiftMessageForEntity($_item); ?>
-                <td class="col message" colspan="7">
-                    <div class="gift message details">
-                        <a href="#"
-                           title="<?php echo __('Close') ?>"
-                           aria-controls="order-item-gift-message-<?php echo $_item->getId()?>"
-                           data-item-id="<?php echo $_item->getId()?>"
-                           class="action close">
-                            <?php echo __('Close') ?>
-                        </a>
-                        <dl class="gift message">
-                            <dt class="gift sender"><strong class="label"><?php echo __('From:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?></dt>
-                            <dt class="gift recipient"><strong class="label"><?php echo __('To:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?></dt>
-                            <dd class="message text"><?php echo $this->helper('Magento\GiftMessage\Helper\Message')->getEscapedGiftMessage($_item) ?></dd>
-                        </dl>
-                    </div>
-                </td>
+<div class="wrapper table order items">
+    <table class="data table order items" id="my-orders-table" summary="<?php echo __('Items Ordered') ?>">
+        <thead>
+            <tr>
+                <th class="col name"><?php echo __('Product Name') ?></th>
+                <th class="col sku"><?php echo __('SKU') ?></th>
+                <th class="col price"><?php echo __('Price') ?></th>
+                <th class="col qty"><?php echo __('Qty') ?></th>
+                <th class="col subtotal"><?php echo __('Subtotal') ?></th>
             </tr>
-            <?php endif ?>
-        </tbody>
-        <?php endforeach; ?>
-</table>
+        </thead>
+        <tfoot>
+            <?php echo $this->getChildHtml('order_totals') ?>
+        </tfoot>
+            <?php $_items = $_order->getItemsCollection(); ?>
+            <?php $_index = 0; ?>
+            <?php $_count = $_items->count(); ?>
+            <?php $_giftMessage = ''?>
+            <?php foreach ($_items as $_item): ?>
+            <?php if ($_item->getParentItem()) continue; ?>
+            <tbody>
+                <?php echo $this->getItemHtml($_item) ?>
+                <?php if ($this->helper('Magento\GiftMessage\Helper\Message')->getIsMessagesAvailable('order_item', $_item) && $_item->getGiftMessageId()): ?>
+                <tr id="order-item-gift-message-<?php echo $_item->getId() ?>" role="region" aria-expanded="false" tabindex="-1" style="display:none;">
+                    <?php $_giftMessage = $this->helper('Magento\GiftMessage\Helper\Message')->getGiftMessageForEntity($_item); ?>
+                    <td class="col message" colspan="7">
+                        <div class="gift message details">
+                            <a href="#"
+                               title="<?php echo __('Close') ?>"
+                               aria-controls="order-item-gift-message-<?php echo $_item->getId()?>"
+                               data-item-id="<?php echo $_item->getId()?>"
+                               class="action close">
+                                <?php echo __('Close') ?>
+                            </a>
+                            <dl class="gift message">
+                                <dt class="gift sender"><strong class="label"><?php echo __('From:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?></dt>
+                                <dt class="gift recipient"><strong class="label"><?php echo __('To:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?></dt>
+                                <dd class="message text"><?php echo $this->helper('Magento\GiftMessage\Helper\Message')->getEscapedGiftMessage($_item) ?></dd>
+                            </dl>
+                        </div>
+                    </td>
+                </tr>
+                <?php endif ?>
+            </tbody>
+            <?php endforeach; ?>
+    </table>
+</div>
 <?php if ($_giftMessage): ?>
     <script type="text/javascript">
         head.js("<?php echo $this->getViewFileUrl('Magento_Sales::gift-message.js')?>", function() {
diff --git a/app/code/Magento/Sales/view/frontend/order/recent.phtml b/app/code/Magento/Sales/view/frontend/order/recent.phtml
index d6ddd2d8484d175979d9ceae726146be6f8b6e0e..d80817a33c2e2f78b9e0c1180b51754ddf72afac 100644
--- a/app/code/Magento/Sales/view/frontend/order/recent.phtml
+++ b/app/code/Magento/Sales/view/frontend/order/recent.phtml
@@ -36,39 +36,41 @@
     <div class="content">
     <?php echo $this->getChildHtml()?>
     <?php if( sizeof($_orders->getItems()) > 0 ): ?>
-        <table class="data table orders recent" id="my-orders-table">
-            <thead>
-                <tr>
-                    <th class="col id"><?php echo __('Order #') ?></th>
-                    <th class="col date"><?php echo __('Date') ?></th>
-                    <th class="col shipping"><?php echo __('Ship To') ?></th>
-                    <th class="col total"><?php echo __('Order Total') ?></th>
-                    <th class="col status"><?php echo __('Status') ?></th>
-                    <th class="col actions">&nbsp;</th>
-                </tr>
-            </thead>
-            <tbody>
-                <?php foreach ($_orders as $_order): ?>
+        <div class="wrapper table orders recent">
+            <table class="data table orders recent" id="my-orders-table">
+                <thead>
                     <tr>
-                        <td class="col id"><?php echo $_order->getRealOrderId() ?></td>
-                        <td class="col date"><?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?></td>
-                        <td class="col shipping"><?php echo $_order->getShippingAddress() ? $this->escapeHtml($_order->getShippingAddress()->getName()) : '&nbsp;' ?></td>
-                        <td class="col total"><?php echo $_order->formatPrice($_order->getGrandTotal()) ?></td>
-                        <td class="col status"><em><?php echo $_order->getStatusLabel() ?></em></td>
-                        <td class="col actions">
-                            <a href="<?php echo $this->getViewUrl($_order) ?>" class="action view">
-                                <span><?php echo __('View Order') ?></span>
-                            </a>
-                            <?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order)) : ?>
-                                <a href="<?php echo $this->getReorderUrl($_order) ?>" class="action order">
-                                    <span><?php echo __('Reorder') ?></span>
-                                </a>
-                            <?php endif ?>
-                        </td>
+                        <th class="col id"><?php echo __('Order #') ?></th>
+                        <th class="col date"><?php echo __('Date') ?></th>
+                        <th class="col shipping"><?php echo __('Ship To') ?></th>
+                        <th class="col total"><?php echo __('Order Total') ?></th>
+                        <th class="col status"><?php echo __('Status') ?></th>
+                        <th class="col actions">&nbsp;</th>
                     </tr>
-                <?php endforeach; ?>
-            </tbody>
-        </table>
+                </thead>
+                <tbody>
+                    <?php foreach ($_orders as $_order): ?>
+                        <tr>
+                            <td class="col id"><?php echo $_order->getRealOrderId() ?></td>
+                            <td class="col date"><?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?></td>
+                            <td class="col shipping"><?php echo $_order->getShippingAddress() ? $this->escapeHtml($_order->getShippingAddress()->getName()) : '&nbsp;' ?></td>
+                            <td class="col total"><?php echo $_order->formatPrice($_order->getGrandTotal()) ?></td>
+                            <td class="col status"><em><?php echo $_order->getStatusLabel() ?></em></td>
+                            <td class="col actions">
+                                <a href="<?php echo $this->getViewUrl($_order) ?>" class="action view">
+                                    <span><?php echo __('View Order') ?></span>
+                                </a>
+                                <?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order)) : ?>
+                                    <a href="<?php echo $this->getReorderUrl($_order) ?>" class="action order">
+                                        <span><?php echo __('Reorder') ?></span>
+                                    </a>
+                                <?php endif ?>
+                            </td>
+                        </tr>
+                    <?php endforeach; ?>
+                </tbody>
+            </table>
+        </div>
     <?php else: ?>
         <div class="message info empty"><span><?php echo __('You have placed no orders.'); ?></span></div>
     <?php endif; ?>
diff --git a/app/code/Magento/Sales/view/frontend/order/shipment/items.phtml b/app/code/Magento/Sales/view/frontend/order/shipment/items.phtml
index c3a54e80093ee77e51b293c3c577dba69106e407..c02d6fd809f517cbc5fb27f3800153bdea2dfd1f 100644
--- a/app/code/Magento/Sales/view/frontend/order/shipment/items.phtml
+++ b/app/code/Magento/Sales/view/frontend/order/shipment/items.phtml
@@ -84,22 +84,24 @@
     </table>
 <?php  endif; ?>
 <div class="order subtitle caption"><strong><?php echo __('Items Shipped') ?></strong></div>
-<table class="data table order items shipment" id="my-shipment-table-<?php echo $_shipment->getId(); ?>">
-    <thead>
-        <tr>
-            <th class="col name"><?php echo __('Product Name') ?></th>
-            <th class="col sku"><?php echo __('SKU') ?></th>
-            <th class="col qty"><?php echo __('Qty Shipped') ?></th>
-        </tr>
-    </thead>
-    <?php $_items = $_shipment->getAllItems(); ?>
-    <?php $_count = count($_items) ?>
-    <?php foreach ($_items as $_item): ?>
-    <?php if ($_item->getOrderItem()->getParentItem()) continue; ?>
-    <tbody>
-        <?php echo $this->getItemHtml($_item) ?>
-    </tbody>
-    <?php endforeach; ?>
-</table>
+<div class="wrapper table order items shipment">
+    <table class="data table order items shipment" id="my-shipment-table-<?php echo $_shipment->getId(); ?>">
+        <thead>
+            <tr>
+                <th class="col name"><?php echo __('Product Name') ?></th>
+                <th class="col sku"><?php echo __('SKU') ?></th>
+                <th class="col qty"><?php echo __('Qty Shipped') ?></th>
+            </tr>
+        </thead>
+        <?php $_items = $_shipment->getAllItems(); ?>
+        <?php $_count = count($_items) ?>
+        <?php foreach ($_items as $_item): ?>
+        <?php if ($_item->getOrderItem()->getParentItem()) continue; ?>
+        <tbody>
+            <?php echo $this->getItemHtml($_item) ?>
+        </tbody>
+        <?php endforeach; ?>
+    </table>
+</div>
 <?php echo $this->getCommentsHtml($_shipment)?>
 <?php endforeach; ?>
diff --git a/app/code/Magento/Sendfriend/view/frontend/send.phtml b/app/code/Magento/Sendfriend/view/frontend/send.phtml
index 8b8d2af96f99ca360e230f1466feaff94619fea6..9cc5b689b8ce68d5dcf249380ae4698c33b5b060 100644
--- a/app/code/Magento/Sendfriend/view/frontend/send.phtml
+++ b/app/code/Magento/Sendfriend/view/frontend/send.phtml
@@ -81,24 +81,29 @@
         </div>
     </fieldset>
 
-    <fieldset class="fieldset recipients" id="recipients-options">
+    <fieldset class="fieldset recipients">
         <?php echo $this->getBlockHtml('formkey')?>
         <legend class="legend"><span><?php echo __('Recipient:') ?></span></legend><br />
+        <div id="recipients-options"></div>
+        <div class="actions">
+            <div class="primary">
+            <?php if (1 < $this->getMaxRecipients()): ?>
+                <button type="button" id="add-recipient-button" class="action add">
+                    <span><?php echo __('Add Recipient') ?></span></button>
+            <?php endif; ?>
+            </div>
+        </div>
+        <div id="max-recipient-message" style="display: none;" class="message notice limit">
+            <?php if ($this->getMaxRecipients()): ?>
+            <span><?php echo __('Maximum %1 email addresses allowed.', $this->getMaxRecipients()) ?></span>
+            <?php endif; ?>
+        </div>
     </fieldset>
     <div class="actions">
         <div class="primary">
             <button type="submit"
                     class="action submit"<?php if (!$this->canSend()): ?> disabled="disabled"<?php endif ?>>
                 <span><?php echo __('Send Email') ?></span></button>
-            <div id="max-recipient-message" style="display: none;" class="message notice limit">
-                <?php if ($this->getMaxRecipients()): ?>
-                <span><?php echo __('Maximum %1 email addresses allowed.', $this->getMaxRecipients()) ?></span>
-                <?php endif; ?>
-            </div>
-            <?php if (1 < $this->getMaxRecipients()): ?>
-                <button type="button" id="add-recipient-button" class="action add">
-                    <span><?php echo __('Add Recipient') ?></span></button>
-            <?php endif; ?>
         </div>
         <div class="secondary">
             <a class="action back" href="#" role="back"><span><?php echo __('Back') ?></span></a>
diff --git a/app/code/Magento/Shipping/Model/Carrier/Tablerate.php b/app/code/Magento/Shipping/Model/Carrier/Tablerate.php
index 1d85d68a630eceaf7bb9dcdc5656d912af273346..afbd940434e9993d2c9e72b00ef9a36fa43ad1f9 100644
--- a/app/code/Magento/Shipping/Model/Carrier/Tablerate.php
+++ b/app/code/Magento/Shipping/Model/Carrier/Tablerate.php
@@ -45,7 +45,7 @@ class Tablerate
     /**
      * @var string
      */
-    protected $_default_condition_name = 'package_weight';
+    protected $_defaultConditionName = 'package_weight';
 
     /**
      * @var array
@@ -150,7 +150,7 @@ class Tablerate
 
         if (!$request->getConditionName()) {
             $conditionName = $this->getConfigData('condition_name');
-            $request->setConditionName($conditionName ? $conditionName : $this->_default_condition_name);
+            $request->setConditionName($conditionName ? $conditionName : $this->_defaultConditionName);
         }
 
          // Package weight and qty free shipping
@@ -187,6 +187,14 @@ class Tablerate
             $method->setCost($rate['cost']);
 
             $result->append($method);
+        } else {
+            /** @var \Magento\Shipping\Model\Rate\Result\Error $error */
+            $error = $this->_rateErrorFactory->create(array('data' => array(
+                'carrier'       => $this->_code,
+                'carrier_title' => $this->getConfigData('title'),
+                'error_message' => $this->getConfigData('specificerrmsg'),
+            )));
+            $result->append($error);
         }
 
         return $result;
diff --git a/app/code/Magento/Shipping/Model/Shipping.php b/app/code/Magento/Shipping/Model/Shipping.php
index d88c2d0b6bee4a713c4cdbeb1dd696ee48cab04f..f0915339718a78bef2acfb222d05999cd2108094 100644
--- a/app/code/Magento/Shipping/Model/Shipping.php
+++ b/app/code/Magento/Shipping/Model/Shipping.php
@@ -90,7 +90,7 @@ class Shipping
     /**
      * @var \Magento\Shipping\Model\Rate\RequestFactory
      */
-    protected $_rateRequestFactory;
+    protected $_shipmentRequestFactory;
 
     /**
      * @var \Magento\Directory\Model\RegionFactory
@@ -108,7 +108,7 @@ class Shipping
      * @param \Magento\Core\Model\StoreManagerInterface $storeManager
      * @param \Magento\Shipping\Model\Carrier\Factory $carrierFactory
      * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory
-     * @param \Magento\Shipping\Model\Rate\RequestFactory $rateRequestFactory
+     * @param \Magento\Shipping\Model\Shipment\RequestFactory $shipmentRequestFactory
      * @param \Magento\Directory\Model\RegionFactory $regionFactory
      * @param \Magento\Math\Division $mathDivision
      */
@@ -118,7 +118,7 @@ class Shipping
         \Magento\Core\Model\StoreManagerInterface $storeManager,
         \Magento\Shipping\Model\Carrier\Factory $carrierFactory,
         \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory,
-        \Magento\Shipping\Model\Rate\RequestFactory $rateRequestFactory,
+        \Magento\Shipping\Model\Shipment\RequestFactory $shipmentRequestFactory,
         \Magento\Directory\Model\RegionFactory $regionFactory,
         \Magento\Math\Division $mathDivision
     ) {
@@ -127,7 +127,7 @@ class Shipping
         $this->_storeManager = $storeManager;
         $this->_carrierFactory = $carrierFactory;
         $this->_rateResultFactory = $rateResultFactory;
-        $this->_rateRequestFactory = $rateRequestFactory;
+        $this->_shipmentRequestFactory = $shipmentRequestFactory;
         $this->_regionFactory = $regionFactory;
         $this->mathDivision = $mathDivision;
     }
@@ -441,7 +441,7 @@ class Shipping
     public function collectRatesByAddress(\Magento\Object $address, $limitCarrier = null)
     {
         /** @var $request \Magento\Shipping\Model\Rate\Request */
-        $request = $this->_rateRequestFactory->create();
+        $request = $this->_shipmentRequestFactory->create();
         $request->setAllItems($address->getAllItems());
         $request->setDestCountryId($address->getCountryId());
         $request->setDestRegionId($address->getRegionId());
diff --git a/app/code/Magento/Shipping/Model/Shipping/Labels.php b/app/code/Magento/Shipping/Model/Shipping/Labels.php
index 83da08148510eb3a689c81d5399ddd1a8e44980c..7c84d72776c593bdec573e4b66683f02d7878610 100644
--- a/app/code/Magento/Shipping/Model/Shipping/Labels.php
+++ b/app/code/Magento/Shipping/Model/Shipping/Labels.php
@@ -48,7 +48,7 @@ class Labels extends \Magento\Shipping\Model\Shipping
      * @param \Magento\Core\Model\StoreManagerInterface $storeManager
      * @param \Magento\Shipping\Model\Carrier\Factory $carrierFactory
      * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory
-     * @param \Magento\Shipping\Model\Rate\RequestFactory $rateRequestFactory
+     * @param \Magento\Shipping\Model\Shipment\RequestFactory $shipmentRequestFactory
      * @param \Magento\Directory\Model\RegionFactory $regionFactory
      * @param \Magento\Math\Division $mathDivision
      * @param \Magento\Backend\Model\Auth\Session $authSession
@@ -59,7 +59,7 @@ class Labels extends \Magento\Shipping\Model\Shipping
         \Magento\Core\Model\StoreManagerInterface $storeManager,
         \Magento\Shipping\Model\Carrier\Factory $carrierFactory,
         \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory,
-        \Magento\Shipping\Model\Rate\RequestFactory $rateRequestFactory,
+        \Magento\Shipping\Model\Shipment\RequestFactory $shipmentRequestFactory,
         \Magento\Directory\Model\RegionFactory $regionFactory,
         \Magento\Math\Division $mathDivision,
         \Magento\Backend\Model\Auth\Session $authSession,
@@ -73,7 +73,7 @@ class Labels extends \Magento\Shipping\Model\Shipping
             $storeManager,
             $carrierFactory,
             $rateResultFactory,
-            $rateRequestFactory,
+            $shipmentRequestFactory,
             $regionFactory,
             $mathDivision
         );
@@ -107,7 +107,7 @@ class Labels extends \Magento\Shipping\Model\Shipping
 
         $originStreet1 = $this->_coreStoreConfig->getConfig(self::XML_PATH_STORE_ADDRESS1, $shipmentStoreId);
         $originStreet2 = $this->_coreStoreConfig->getConfig(self::XML_PATH_STORE_ADDRESS2, $shipmentStoreId);
-        $storeInfo = new \Magento\Object($this->_coreStoreConfig->getConfig('general/store_information', $shipmentStoreId));
+        $storeInfo = new \Magento\Object((array)$this->_coreStoreConfig->getConfig('general/store_information', $shipmentStoreId));
 
         if (!$admin->getFirstname() || !$admin->getLastname() || !$storeInfo->getName() || !$storeInfo->getPhone()
             || !$originStreet1 || !$this->_coreStoreConfig->getConfig(self::XML_PATH_STORE_CITY, $shipmentStoreId)
@@ -120,7 +120,7 @@ class Labels extends \Magento\Shipping\Model\Shipping
         }
 
         /** @var $request \Magento\Shipping\Model\Shipment\Request */
-        $request = $this->_request;
+        $request = $this->_shipmentRequestFactory->create();
         $request->setOrderShipment($orderShipment);
         $request->setShipperContactPersonName($admin->getName());
         $request->setShipperContactPersonFirstName($admin->getFirstname());
diff --git a/app/code/Magento/Shipping/etc/adminhtml/system.xml b/app/code/Magento/Shipping/etc/adminhtml/system.xml
index 5788ff89421358f6c24f1ca8abee073212fbfd0a..2e9022e2565b7412c13f552ce4f4f2e2bc72e353 100644
--- a/app/code/Magento/Shipping/etc/adminhtml/system.xml
+++ b/app/code/Magento/Shipping/etc/adminhtml/system.xml
@@ -206,6 +206,7 @@
                 </field>
                 <field id="showmethod" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="0">
                     <label>Show Method if Not Applicable</label>
+                    <frontend_class>shipping-skip-hide</frontend_class>
                     <source_model>Magento\Backend\Model\Config\Source\Yesno</source_model>
                 </field>
                 <field id="specificerrmsg" translate="label" type="textarea" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
diff --git a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php
index 93cae32226666af67012ee520688b8a245e12553..290c23d575e7030122a2010bb034cc502086b599 100644
--- a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php
+++ b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php
@@ -244,7 +244,7 @@ class Storage
         if (!$this->mediaWriteDirectory->isExist($currentPath)) {
             throw new \Magento\Core\Exception(__('We cannot find a directory with this name.'));
         }
-        $paths = $this->mediaWriteDirectory->search('#.*#', $currentPath);
+        $paths = $this->mediaWriteDirectory->search('.*', $currentPath);
         $directories = array();
         foreach ($paths as $path) {
             if ($this->mediaWriteDirectory->isDirectory($path)) {
@@ -261,7 +261,7 @@ class Storage
      */
     public function getFilesCollection()
     {
-        $paths = $this->mediaWriteDirectory->search('#.*#', $this->_helper->getCurrentPath());
+        $paths = $this->mediaWriteDirectory->search('.*', $this->_helper->getCurrentPath());
         $files = array();
         $requestParams = $this->_helper->getRequestParams();
         $storageType = $this->_helper->getStorageType();
diff --git a/app/code/Magento/Theme/view/frontend/layout/default.xml b/app/code/Magento/Theme/view/frontend/layout/default.xml
index 916209e43ed7049e91e9191e8e2dc89900e1ee29..3f4d4d139b9d713cfe8f961e47366fb53a0fb259 100644
--- a/app/code/Magento/Theme/view/frontend/layout/default.xml
+++ b/app/code/Magento/Theme/view/frontend/layout/default.xml
@@ -26,7 +26,7 @@
 <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <block class="Magento\Theme\Block\Html" name="root" output="1" template="3columns.phtml">
         <block class="Magento\Theme\Block\Html\Head" name="head" as="head">
-            <block class="Magento\View\Element\Js\Cookie" name="js_cookies" template="Magento_Theme:js/cookie.phtml"/>
+            <block class="Magento\View\Element\Js\Cookie" name="js_cookies" template="Magento_Theme::js/cookie.phtml"/>
         </block>
         <container name="after_body_start" as="after_body_start" label="Page Top"/>
         <container name="header-container" label="Page Header Container" as="header-container" htmlTag="header" htmlClass="header">
diff --git a/app/code/Magento/Usa/Helper/Data.php b/app/code/Magento/Usa/Helper/Data.php
index b4e58f212c9a7e4d9d200c60869a5cb747ff9a44..80451962327ea8c97c19110e5062244ff02dbafb 100644
--- a/app/code/Magento/Usa/Helper/Data.php
+++ b/app/code/Magento/Usa/Helper/Data.php
@@ -127,25 +127,25 @@ class Data extends \Magento\App\Helper\AbstractHelper
     public function displayGirthValue($shippingMethod)
     {
         if (in_array($shippingMethod, array(
-            'usps_Priority Mail International',
-            'usps_Priority Mail International Small Flat Rate Box',
-            'usps_Priority Mail International Medium Flat Rate Box',
-            'usps_Priority Mail International Large Flat Rate Box',
-            'usps_Priority Mail International Flat Rate Envelope',
-            'usps_Express Mail International Flat Rate Envelope',
-            'usps_Express Mail Hold For Pickup',
-            'usps_Express Mail International',
-            'usps_First-Class Mail International Package',
-            'usps_First-Class Mail International Parcel',
-            'usps_First-Class Mail International Large Envelope',
-            'usps_First-Class Mail International',
-            'usps_Global Express Guaranteed (GXG)',
-            'usps_USPS GXG Envelopes',
-            'usps_Global Express Guaranteed Non-Document Non-Rectangular',
-            'usps_Media Mail',
-            'usps_Parcel Post',
-            'usps_Express Mail',
-            'usps_Priority Mail'
+            'usps_0_FCLE', // First-Class Mail Large Envelope
+            'usps_1',      // Priority Mail
+            'usps_2',      // Priority Mail Express Hold For Pickup
+            'usps_3',      // Priority Mail Express
+            'usps_4',      // Standard Post
+            'usps_6',      // Media Mail
+            'usps_INT_1',  // Priority Mail Express International
+            'usps_INT_2',  // Priority Mail International
+            'usps_INT_4',  // Global Express Guaranteed (GXG)
+            'usps_INT_7',  // Global Express Guaranteed Non-Document Non-Rectangular
+            'usps_INT_8',  // Priority Mail International Flat Rate Envelope
+            'usps_INT_9',  // Priority Mail International Medium Flat Rate Box
+            'usps_INT_10', // Priority Mail Express International Flat Rate Envelope
+            'usps_INT_11', // Priority Mail International Large Flat Rate Box
+            'usps_INT_12', // USPS GXG Envelopes
+            'usps_INT_14', // First-Class Mail International Large Envelope
+            'usps_INT_16', // Priority Mail International Small Flat Rate Box
+            'usps_INT_20', // Priority Mail International Small Flat Rate Envelope
+            'usps_INT_26', // Priority Mail Express International Flat Rate Boxes
         ))) {
             return true;
         } else {
diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl.php
index ee182bdc33204e18efa43fb3f553d32f38f131d7..422d5d8371a8afb337c7ec7ba4ec0c05e9cb4456 100644
--- a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl.php
+++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl.php
@@ -849,10 +849,6 @@ class Dhl
         $priceArr = array();
         $errorTitle = 'Unable to retrieve quotes';
 
-        $tr = get_html_translation_table(HTML_ENTITIES);
-        unset($tr['<'], $tr['>'], $tr['"']);
-        $response = str_replace(array_keys($tr), array_values($tr), $response);
-
         if (strlen(trim($response)) > 0) {
             if (strpos(trim($response), '<?xml') === 0) {
                 $xml = simplexml_load_string($response);
diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International.php
index b621578c4b2816e6b2fef705e91074ba18c9b941..61343c0f73468ec1379794182f9d090ba5bce5cd 100644
--- a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International.php
+++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/International.php
@@ -981,10 +981,6 @@ class International
      */
     protected function _parseResponse($response)
     {
-        $htmlTranslationTable = get_html_translation_table(HTML_ENTITIES);
-        unset($htmlTranslationTable['<'], $htmlTranslationTable['>'], $htmlTranslationTable['"']);
-        $response = str_replace(array_keys($htmlTranslationTable), array_values($htmlTranslationTable), $response);
-
         $responseError =  __('The response is in wrong format.');
 
         if (strlen(trim($response)) > 0) {
@@ -1704,10 +1700,6 @@ class International
         $errorTitle = __('Unable to retrieve tracking');
         $resultArr = array();
 
-        $htmlTranslationTable = get_html_translation_table(HTML_ENTITIES);
-        unset($htmlTranslationTable['<'], $htmlTranslationTable['>'], $htmlTranslationTable['"']);
-        $response = str_replace(array_keys($htmlTranslationTable), array_values($htmlTranslationTable), $response);
-
         if (strlen(trim($response)) > 0) {
             $xml = simplexml_load_string($response);
             if (!is_object($xml)) {
diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php
index e8b32be7a26b8eb7396473f307e3312180ba29a3..6276400969f40e494a3516f7cc7bf68786e70155 100644
--- a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php
+++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php
@@ -49,15 +49,32 @@ class Pdf
      */
     protected $_request;
 
+    /**
+     * @var Pdf\PageBuilder
+     */
+    protected $_pageBuilder;
+
+    /**
+     * @var Pdf\PageFactory
+     */
+    protected $_pageFactory;
+
     /**
      * Dhl International Label Creation Class constructor
      *
      * @param array $arguments
+     * @param Pdf\PageBuilder $pageBuilder
+     * @param Pdf\PageFactory $pageFactory
      */
-    public function __construct(array $arguments)
-    {
-        $this->_info    = $arguments['info'];
+    public function __construct(
+        array $arguments,
+        \Magento\Usa\Model\Shipping\Carrier\Dhl\Label\Pdf\PageBuilder $pageBuilder,
+        \Magento\Usa\Model\Shipping\Carrier\Dhl\Label\Pdf\PageFactory $pageFactory
+    ) {
+        $this->_info = $arguments['info'];
         $this->_request = $arguments['request'];
+        $this->_pageBuilder = $pageBuilder;
+        $this->_pageFactory = $pageFactory;
     }
 
     /**
@@ -69,14 +86,10 @@ class Pdf
     {
         $pdf = new \Zend_Pdf();
 
-        $pdfBuilder = new \Magento\Usa\Model\Shipping\Carrier\Dhl\Label\Pdf\PageBuilder();
-
-        $template = new \Magento\Usa\Model\Shipping\Carrier\Dhl\Label\Pdf\Page(\Zend_Pdf_Page::SIZE_A4_LANDSCAPE);
-        $pdfBuilder->setPage($template)
+        $template = $this->_pageFactory->create(array('param1' => \Zend_Pdf_Page::SIZE_A4_LANDSCAPE));
+        $this->_pageBuilder->setPage($template)
             ->addProductName((string)$this->_info->ProductShortName)
             ->addProductContentCode((string)$this->_info->ProductContentCode)
-        //->addUnitId({unitId})
-        //->addReferenceData({referenceData})
             ->addSenderInfo($this->_info->Shipper)
             ->addOriginInfo((string)$this->_info->OriginServiceArea->ServiceAreaCode)
             ->addReceiveInfo($this->_info->Consignee)
@@ -101,8 +114,8 @@ class Pdf
         $packages = array_values($this->_request->getPackages());
         $i = 0;
         foreach ($this->_info->Pieces->Piece as $piece) {
-            $page = new \Magento\Usa\Model\Shipping\Carrier\Dhl\Label\Pdf\Page($template);
-            $pdfBuilder->setPage($page)
+            $page = $this->_pageFactory->create(array('param1' => $template));
+                $this->_pageBuilder->setPage($page)
                 ->addPieceNumber((int)$piece->PieceNumber, (int)$this->_info->Piece)
                 ->addContentInfo($packages[$i])
                 ->addPieceIdBarcode(
diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php
index b1a6ee177fcd87abe158a6ab6f0fd3d6b3932cab..e4e03435c96c68561cca0f98d1d3b064e191f049 100644
--- a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php
+++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php
@@ -115,7 +115,7 @@ class Page extends \Zend_Pdf_Page
      * @throws \Zend_Pdf_Exception
      * @return \Magento\Usa\Model\Shipping\Carrier\Dhl\Label\Pdf\Page
      */
-    public function drawText($text, $x, $y, $charEncoding = '', $align = self::ALIGN_LEFT)
+    public function drawText($text, $x, $y, $charEncoding = 'UTF-8', $align = self::ALIGN_LEFT)
     {
         $left = null;
         switch ($align) {
@@ -156,7 +156,7 @@ class Page extends \Zend_Pdf_Page
                 $y = $this->drawLines(array_filter($subLines), $x, $y, $maxWidth, $align);
                 continue;
             }
-            $this->drawText($line, $x, $y, null, $align);
+            $this->drawText($line, $x, $y, 'UTF-8', $align);
             $y -= ceil($this->getFontSize());
         }
         return $y;
diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php
index 37694a8ad230d836c10c589bdec80ad5b04f0ba9..c394c71a3a79c2f36658de30a2ded6433d34c370 100644
--- a/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php
+++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php
@@ -408,7 +408,7 @@ class PageBuilder
         if (!strlen($code)) {
             throw new \InvalidArgumentException(__('Destination facility code is empty'));
         }
-        $this->_page->drawText($code, $this->_x(144), $this->_y(186), null,
+        $this->_page->drawText($code, $this->_x(144), $this->_y(186), 'UTF-8',
             \Magento\Usa\Model\Shipping\Carrier\Dhl\Label\Pdf\Page::ALIGN_CENTER
         );
 
@@ -559,7 +559,7 @@ class PageBuilder
     {
         $this->_page->saveGS();
 
-        if(!strlen($number) || !strlen($barCode)) {
+        if (!strlen($number) || !strlen($barCode)) {
             throw new \InvalidArgumentException(__('Waybill barcode information is missing'));
         }
         $image = new \Zend_Pdf_Resource_Image_Png("data://image/png;base64," . $barCode);
diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Usps.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Usps.php
old mode 100644
new mode 100755
index 7ee88457929e6c2871b6e51e5f99ee97a8054a6b..a37656e60fb8bd5b08c4f031643cf020e5267f8c
--- a/app/code/Magento/Usa/Model/Shipping/Carrier/Usps.php
+++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Usps.php
@@ -135,6 +135,11 @@ class Usps
      */
     protected $_productCollFactory;
 
+    /**
+     * @var \Zend_Http_ClientFactory
+     */
+    protected $_httpClientFactory;
+
     /**
      * @param \Magento\Core\Model\Store\Config $coreStoreConfig
      * @param \Magento\Shipping\Model\Rate\Result\ErrorFactory $rateErrorFactory
@@ -151,6 +156,7 @@ class Usps
      * @param \Magento\Directory\Helper\Data $directoryData
      * @param \Magento\Usa\Helper\Data $usaData
      * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory
+     * @param \Zend_Http_ClientFactory $httpClientFactory
      * @param array $data
      * 
      * @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -171,11 +177,12 @@ class Usps
         \Magento\Directory\Helper\Data $directoryData,
         \Magento\Usa\Helper\Data $usaData,
         \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory,
+        \Zend_Http_ClientFactory $httpClientFactory,
         array $data = array()
     ) {
         $this->_usaData = $usaData;
         $this->_productCollFactory = $productCollFactory;
-        $this->_xmlElFactory = $xmlElFactory;
+        $this->_httpClientFactory = $httpClientFactory;
         parent::__construct(
             $coreStoreConfig,
             $rateErrorFactory,
@@ -407,7 +414,7 @@ class Usps
                 $service = $r->getService();
             }
             if ($r->getContainer() == 'FLAT RATE BOX' || $r->getContainer() == 'FLAT RATE ENVELOPE') {
-                $service = 'PRIORITY';
+                $service = 'Priority';
             }
             $package->addChild('Service', $service);
 
@@ -478,7 +485,7 @@ class Usps
                 if (!$url) {
                     $url = $this->_defaultGatewayUrl;
                 }
-                $client = new \Zend_Http_Client();
+                $client = $this->_httpClientFactory->create();
                 $client->setUri($url);
                 $client->setConfig(array('maxredirects'=>0, 'timeout'=>30));
                 $client->setParameterGet('API', $api);
@@ -494,6 +501,7 @@ class Usps
             }
             $this->_debug($debugData);
         }
+
         return $this->_parseXmlResponse($responseBody);
     }
 
@@ -506,6 +514,7 @@ class Usps
      */
     protected function _parseXmlResponse($response)
     {
+        $r = $this->_rawRequest;
         $costArr = array();
         $priceArr = array();
         if (strlen(trim($response)) > 0) {
@@ -517,39 +526,27 @@ class Usps
                         $response
                     );
                 }
-
                 $xml = simplexml_load_string($response);
 
                 if (is_object($xml)) {
-                    if (is_object($xml->Number) && is_object($xml->Description) && (string)$xml->Description!='') {
-                        $errorTitle = (string)$xml->Description;
-                    } elseif (is_object($xml->Package)
-                          && is_object($xml->Package->Error)
-                          && is_object($xml->Package->Error->Description)
-                          && (string)$xml->Package->Error->Description!=''
-                    ) {
-                        $errorTitle = (string)$xml->Package->Error->Description;
-                    } else {
-                        $errorTitle = 'Sorry, something went wrong. Please try again or contact us and we\'ll try to help.';
-                    }
-                    $r = $this->_rawRequest;
-                    $allowedMethods = explode(",", $this->getConfigData('allowed_methods'));
-                    $allMethods = $this->getCode('method');
-                    $newMethod = false;
+                    $allowedMethods = explode(',', $this->getConfigData('allowed_methods'));
+                    $serviceCodeToActualNameMap = array();
+                    /**
+                     * US Rates
+                     */
                     if ($this->_isUSCountry($r->getDestCountryId())) {
                         if (is_object($xml->Package) && is_object($xml->Package->Postage)) {
                             foreach ($xml->Package->Postage as $postage) {
                                 $serviceName = $this->_filterServiceName((string)$postage->MailService);
-                                $postage->MailService = $serviceName;
-                                if (in_array($serviceName, $allowedMethods)) {
-                                    $costArr[$serviceName] = (string)$postage->Rate;
-                                    $priceArr[$serviceName] = $this->getMethodPrice(
+                                $_serviceCode = $this->getCode('method_to_code', $serviceName);
+                                $serviceCode = $_serviceCode ? $_serviceCode : (string)$postage->attributes()->CLASSID;
+                                $serviceCodeToActualNameMap[$serviceCode] = $serviceName;
+                                if (in_array($serviceCode, $allowedMethods)) {
+                                    $costArr[$serviceCode] = (string)$postage->Rate;
+                                    $priceArr[$serviceCode] = $this->getMethodPrice(
                                         (string)$postage->Rate,
-                                        $serviceName
+                                        $serviceCode
                                     );
-                                } elseif (!in_array($serviceName, $allMethods)) {
-                                    $allMethods[] = $serviceName;
-                                    $newMethod = true;
                                 }
                             }
                             asort($priceArr);
@@ -561,24 +558,20 @@ class Usps
                         if (is_object($xml->Package) && is_object($xml->Package->Service)) {
                             foreach ($xml->Package->Service as $service) {
                                 $serviceName = $this->_filterServiceName((string)$service->SvcDescription);
-                                $service->SvcDescription = $serviceName;
-                                if (in_array($serviceName, $allowedMethods)) {
-                                    $costArr[$serviceName] = (string)$service->Postage;
-                                    $priceArr[$serviceName] = $this->getMethodPrice(
+                                $serviceCode = 'INT_' . (string)$service->attributes()->ID;
+                                $serviceCodeToActualNameMap[$serviceCode] = $serviceName;
+                                if (in_array($serviceCode, $allowedMethods)) {
+                                    $costArr[$serviceCode] = (string)$service->Postage;
+                                    $priceArr[$serviceCode] = $this->getMethodPrice(
                                         (string)$service->Postage,
-                                        $serviceName
+                                        $serviceCode
                                     );
-                                } elseif (!in_array($serviceName, $allMethods)) {
-                                    $allMethods[] = $serviceName;
-                                    $newMethod = true;
                                 }
                             }
                             asort($priceArr);
                         }
                     }
                 }
-            } else {
-                $errorTitle = 'Response is in the wrong format';
             }
         }
 
@@ -595,7 +588,11 @@ class Usps
                 $rate->setCarrier('usps');
                 $rate->setCarrierTitle($this->getConfigData('title'));
                 $rate->setMethod($method);
-                $rate->setMethodTitle($method);
+                $rate->setMethodTitle(
+                    isset($serviceCodeToActualNameMap[$method])
+                        ? $serviceCodeToActualNameMap[$method]
+                        : $this->getCode('method', $method)
+                );
                 $rate->setCost($costArr[$method]);
                 $rate->setPrice($price);
                 $result->append($rate);
@@ -615,59 +612,171 @@ class Usps
     public function getCode($type, $code='')
     {
         $codes = array(
+            'method' => array(
+                '0_FCLE' => __('First-Class Mail Large Envelope'),
+                '0_FCL'  => __('First-Class Mail Letter'),
+                '0_FCP'  => __('First-Class Mail Parcel'),
+                '0_FCPC' => __('First-Class Mail Postcards'),
+                '1'      => __('Priority Mail'),
+                '2'      => __('Priority Mail Express Hold For Pickup'),
+                '3'      => __('Priority Mail Express'),
+                '4'      => __('Standard Post'),
+                '6'      => __('Media Mail'),
+                '7'      => __('Library Mail'),
+                '13'     => __('Priority Mail Express Flat Rate Envelope'),
+                '15'     => __('First-Class Mail Large Postcards'),
+                '16'     => __('Priority Mail Flat Rate Envelope'),
+                '17'     => __('Priority Mail Medium Flat Rate Box'),
+                '22'     => __('Priority Mail Large Flat Rate Box'),
+                '23'     => __('Priority Mail Express Sunday/Holiday Delivery'),
+                '25'     => __('Priority Mail Express Sunday/Holiday Delivery Flat Rate Envelope'),
+                '27'     => __('Priority Mail Express Flat Rate Envelope Hold For Pickup'),
+                '28'     => __('Priority Mail Small Flat Rate Box'),
+                '29'     => __('Priority Mail Padded Flat Rate Envelope'),
+                '30'     => __('Priority Mail Express Legal Flat Rate Envelope'),
+                '31'     => __('Priority Mail Express Legal Flat Rate Envelope Hold For Pickup'),
+                '32'     => __('Priority Mail Express Sunday/Holiday Delivery Legal Flat Rate Envelope'),
+                '33'     => __('Priority Mail Hold For Pickup'),
+                '34'     => __('Priority Mail Large Flat Rate Box Hold For Pickup'),
+                '35'     => __('Priority Mail Medium Flat Rate Box Hold For Pickup'),
+                '36'     => __('Priority Mail Small Flat Rate Box Hold For Pickup'),
+                '37'     => __('Priority Mail Flat Rate Envelope Hold For Pickup'),
+                '38'     => __('Priority Mail Gift Card Flat Rate Envelope'),
+                '39'     => __('Priority Mail Gift Card Flat Rate Envelope Hold For Pickup'),
+                '40'     => __('Priority Mail Window Flat Rate Envelope'),
+                '41'     => __('Priority Mail Window Flat Rate Envelope Hold For Pickup'),
+                '42'     => __('Priority Mail Small Flat Rate Envelope'),
+                '43'     => __('Priority Mail Small Flat Rate Envelope Hold For Pickup'),
+                '44'     => __('Priority Mail Legal Flat Rate Envelope'),
+                '45'     => __('Priority Mail Legal Flat Rate Envelope Hold For Pickup'),
+                '46'     => __('Priority Mail Padded Flat Rate Envelope Hold For Pickup'),
+                '47'     => __('Priority Mail Regional Rate Box A'),
+                '48'     => __('Priority Mail Regional Rate Box A Hold For Pickup'),
+                '49'     => __('Priority Mail Regional Rate Box B'),
+                '50'     => __('Priority Mail Regional Rate Box B Hold For Pickup'),
+                '53'     => __('First-Class Package Service Hold For Pickup'),
+                '55'     => __('Priority Mail Express Flat Rate Boxes'),
+                '56'     => __('Priority Mail Express Flat Rate Boxes Hold For Pickup'),
+                '57'     => __('Priority Mail Express Sunday/Holiday Delivery Flat Rate Boxes'),
+                '58'     => __('Priority Mail Regional Rate Box C'),
+                '59'     => __('Priority Mail Regional Rate Box C Hold For Pickup'),
+                '61'     => __('First-Class Package Service'),
+                '62'     => __('Priority Mail Express Padded Flat Rate Envelope'),
+                '63'     => __('Priority Mail Express Padded Flat Rate Envelope Hold For Pickup'),
+                '64'     => __('Priority Mail Express Sunday/Holiday Delivery Padded Flat Rate Envelope'),
+                'INT_1'  => __('Priority Mail Express International'),
+                'INT_2'  => __('Priority Mail International'),
+                'INT_4'  => __('Global Express Guaranteed (GXG)'),
+                'INT_5'  => __('Global Express Guaranteed Document'),
+                'INT_6'  => __('Global Express Guaranteed Non-Document Rectangular'),
+                'INT_7'  => __('Global Express Guaranteed Non-Document Non-Rectangular'),
+                'INT_8'  => __('Priority Mail International Flat Rate Envelope'),
+                'INT_9'  => __('Priority Mail International Medium Flat Rate Box'),
+                'INT_10' => __('Priority Mail Express International Flat Rate Envelope'),
+                'INT_11' => __('Priority Mail International Large Flat Rate Box'),
+                'INT_12' => __('USPS GXG Envelopes'),
+                'INT_13' => __('First-Class Mail International Letter'),
+                'INT_14' => __('First-Class Mail International Large Envelope'),
+                'INT_15' => __('First-Class Package International Service'),
+                'INT_16' => __('Priority Mail International Small Flat Rate Box'),
+                'INT_17' => __('Priority Mail Express International Legal Flat Rate Envelope'),
+                'INT_18' => __('Priority Mail International Gift Card Flat Rate Envelope'),
+                'INT_19' => __('Priority Mail International Window Flat Rate Envelope'),
+                'INT_20' => __('Priority Mail International Small Flat Rate Envelope'),
+                'INT_21' => __('First-Class Mail International Postcard'),
+                'INT_22' => __('Priority Mail International Legal Flat Rate Envelope'),
+                'INT_23' => __('Priority Mail International Padded Flat Rate Envelope'),
+                'INT_24' => __('Priority Mail International DVD Flat Rate priced box'),
+                'INT_25' => __('Priority Mail International Large Video Flat Rate priced box'),
+                'INT_26' => __('Priority Mail Express International Flat Rate Boxes'),
+                'INT_27' => __('Priority Mail Express International Padded Flat Rate Envelope'),
+            ),
 
-            'service'=>array(
-                'FIRST CLASS' => __('First-Class'),
-                'PRIORITY'    => __('Priority Mail'),
-                'EXPRESS'     => __('Express Mail'),
-                'BPM'         => __('Bound Printed Matter'),
-                'PARCEL'      => __('Parcel Post'),
-                'MEDIA'       => __('Media Mail'),
-                'LIBRARY'     => __('Library'),
+            'service_to_code' => array(
+                '0_FCLE' => 'First Class',
+                '0_FCL'  => 'First Class',
+                '0_FCP'  => 'First Class',
+                '0_FCPC' => 'First Class',
+                '1'      => 'Priority',
+                '2'      => 'Priority Express',
+                '3'      => 'Priority Express',
+                '4'      => 'Standard Post',
+                '6'      => 'Media',
+                '7'      => 'Library',
+                '13'     => 'Priority Express',
+                '15'     => 'First Class',
+                '16'     => 'Priority',
+                '17'     => 'Priority',
+                '22'     => 'Priority',
+                '23'     => 'Priority Express',
+                '25'     => 'Priority Express',
+                '27'     => 'Priority Express',
+                '28'     => 'Priority',
+                '29'     => 'Priority',
+                '30'     => 'Priority Express',
+                '31'     => 'Priority Express',
+                '32'     => 'Priority Express',
+                '33'     => 'Priority',
+                '34'     => 'Priority',
+                '35'     => 'Priority',
+                '36'     => 'Priority',
+                '37'     => 'Priority',
+                '38'     => 'Priority',
+                '39'     => 'Priority',
+                '40'     => 'Priority',
+                '41'     => 'Priority',
+                '42'     => 'Priority',
+                '43'     => 'Priority',
+                '44'     => 'Priority',
+                '45'     => 'Priority',
+                '46'     => 'Priority',
+                '47'     => 'Priority',
+                '48'     => 'Priority',
+                '49'     => 'Priority',
+                '50'     => 'Priority',
+                '53'     => 'First Class',
+                '55'     => 'Priority Express',
+                '56'     => 'Priority Express',
+                '57'     => 'Priority Express',
+                '58'     => 'Priority',
+                '59'     => 'Priority',
+                '61'     => 'First Class',
+                '62'     => 'Priority Express',
+                '63'     => 'Priority Express',
+                '64'     => 'Priority Express',
+                'INT_1'  => 'Priority Express',
+                'INT_2'  => 'Priority',
+                'INT_4'  => 'Priority Express',
+                'INT_5'  => 'Priority Express',
+                'INT_6'  => 'Priority Express',
+                'INT_7'  => 'Priority Express',
+                'INT_8'  => 'Priority',
+                'INT_9'  => 'Priority',
+                'INT_10' => 'Priority Express',
+                'INT_11' => 'Priority',
+                'INT_12' => 'Priority Express',
+                'INT_13' => 'First Class',
+                'INT_14' => 'First Class',
+                'INT_15' => 'First Class',
+                'INT_16' => 'Priority',
+                'INT_17' => 'Priority',
+                'INT_18' => 'Priority',
+                'INT_19' => 'Priority',
+                'INT_20' => 'Priority',
+                'INT_21' => 'First Class',
+                'INT_22' => 'Priority',
+                'INT_23' => 'Priority',
+                'INT_24' => 'Priority',
+                'INT_25' => 'Priority',
+                'INT_26' => 'Priority Express',
+                'INT_27' => 'Priority Express',
             ),
 
-            'service_to_code'=>array(
-                'First-Class'                                   => 'FIRST CLASS',
-                'First-Class Mail International Large Envelope' => 'FIRST CLASS',
-                'First-Class Mail International Letter'         => 'FIRST CLASS',
-                'First-Class Mail International Package'        => 'FIRST CLASS',
-                'First-Class Mail International Parcel'         => 'FIRST CLASS',
-                'First-Class Mail'                 => 'FIRST CLASS',
-                'First-Class Mail Flat'            => 'FIRST CLASS',
-                'First-Class Mail Large Envelope'  => 'FIRST CLASS',
-                'First-Class Mail International'   => 'FIRST CLASS',
-                'First-Class Mail Letter'          => 'FIRST CLASS',
-                'First-Class Mail Parcel'          => 'FIRST CLASS',
-                'First-Class Mail Package'         => 'FIRST CLASS',
-                'Parcel Post'                      => 'PARCEL',
-                'Bound Printed Matter'             => 'BPM',
-                'Media Mail'                       => 'MEDIA',
-                'Library Mail'                     => 'LIBRARY',
-                'Express Mail'                     => 'EXPRESS',
-                'Express Mail PO to PO'            => 'EXPRESS',
-                'Express Mail Flat Rate Envelope'  => 'EXPRESS',
-                'Express Mail Flat-Rate Envelope Sunday/Holiday Guarantee'  => 'EXPRESS',
-                'Express Mail Sunday/Holiday Guarantee'            => 'EXPRESS',
-                'Express Mail Flat Rate Envelope Hold For Pickup'  => 'EXPRESS',
-                'Express Mail Hold For Pickup'                     => 'EXPRESS',
-                'Global Express Guaranteed (GXG)'                  => 'EXPRESS',
-                'Global Express Guaranteed Non-Document Rectangular'     => 'EXPRESS',
-                'Global Express Guaranteed Non-Document Non-Rectangular' => 'EXPRESS',
-                'USPS GXG Envelopes'                               => 'EXPRESS',
-                'Express Mail International'                       => 'EXPRESS',
-                'Express Mail International Flat Rate Envelope'    => 'EXPRESS',
-                'Priority Mail'                        => 'PRIORITY',
-                'Priority Mail Small Flat Rate Box'    => 'PRIORITY',
-                'Priority Mail Medium Flat Rate Box'   => 'PRIORITY',
-                'Priority Mail Large Flat Rate Box'    => 'PRIORITY',
-                'Priority Mail Flat Rate Box'          => 'PRIORITY',
-                'Priority Mail Flat Rate Envelope'     => 'PRIORITY',
-                'Priority Mail International'                            => 'PRIORITY',
-                'Priority Mail International Flat Rate Envelope'         => 'PRIORITY',
-                'Priority Mail International Small Flat Rate Box'        => 'PRIORITY',
-                'Priority Mail International Medium Flat Rate Box'       => 'PRIORITY',
-                'Priority Mail International Large Flat Rate Box'        => 'PRIORITY',
-                'Priority Mail International Flat Rate Box'              => 'PRIORITY'
+            // Added because USPS has different services but with same CLASSID value, which is "0"
+            'method_to_code' => array(
+                'First-Class Mail Large Envelope' => '0_FCLE',
+                'First-Class Mail Letter'         => '0_FCL',
+                'First-Class Mail Parcel'         => '0_FCP',
             ),
 
             'first_class_mail_type'=>array(
@@ -690,33 +799,49 @@ class Usps
                     'filters'    => array(
                         'within_us' => array(
                             'method' => array(
-                                'Express Mail Flat Rate Envelope',
-                                'Express Mail Flat Rate Envelope Hold For Pickup',
+                                'Priority Mail Express Flat Rate Envelope',
+                                'Priority Mail Express Flat Rate Envelope Hold For Pickup',
                                 'Priority Mail Flat Rate Envelope',
                                 'Priority Mail Large Flat Rate Box',
                                 'Priority Mail Medium Flat Rate Box',
                                 'Priority Mail Small Flat Rate Box',
-                                'Express Mail',
+                                'Priority Mail Express Hold For Pickup',
+                                'Priority Mail Express',
                                 'Priority Mail',
-                                'Parcel Post',
+                                'Priority Mail Hold For Pickup',
+                                'Priority Mail Large Flat Rate Box Hold For Pickup',
+                                'Priority Mail Medium Flat Rate Box Hold For Pickup',
+                                'Priority Mail Small Flat Rate Box Hold For Pickup',
+                                'Priority Mail Flat Rate Envelope Hold For Pickup',
+                                'Priority Mail Small Flat Rate Envelope',
+                                'Priority Mail Small Flat Rate Envelope Hold For Pickup',
+                                'First-Class Package Service Hold For Pickup',
+                                'Priority Mail Express Flat Rate Boxes',
+                                'Priority Mail Express Flat Rate Boxes Hold For Pickup',
+                                'Standard Post',
                                 'Media Mail',
                                 'First-Class Mail Large Envelope',
+                                'Priority Mail Express Sunday/Holiday Delivery',
+                                'Priority Mail Express Sunday/Holiday Delivery Flat Rate Envelope',
+                                'Priority Mail Express Sunday/Holiday Delivery Flat Rate Boxes',
                             )
                         ),
                         'from_us' => array(
                             'method' => array(
-                                'Express Mail International Flat Rate Envelope',
+                                'Priority Mail Express International Flat Rate Envelope',
                                 'Priority Mail International Flat Rate Envelope',
                                 'Priority Mail International Large Flat Rate Box',
                                 'Priority Mail International Medium Flat Rate Box',
                                 'Priority Mail International Small Flat Rate Box',
+                                'Priority Mail International Small Flat Rate Envelope',
+                                'Priority Mail Express International Flat Rate Boxes',
                                 'Global Express Guaranteed (GXG)',
                                 'USPS GXG Envelopes',
-                                'Express Mail International',
+                                'Priority Mail Express International',
                                 'Priority Mail International',
-                                'First-Class Mail International Package',
+                                'First-Class Mail International Letter',
                                 'First-Class Mail International Large Envelope',
-                                'First-Class Mail International Parcel',
+                                'First-Class Package International Service',
                             )
                         )
                     )
@@ -729,6 +854,11 @@ class Usps
                                 'Priority Mail Large Flat Rate Box',
                                 'Priority Mail Medium Flat Rate Box',
                                 'Priority Mail Small Flat Rate Box',
+                                'Priority Mail International Large Flat Rate Box',
+                                'Priority Mail International Medium Flat Rate Box',
+                                'Priority Mail International Small Flat Rate Box',
+                                'Priority Mail Express Sunday/Holiday Delivery Flat Rate Boxes',
+
                             )
                         ),
                         'from_us' => array(
@@ -736,6 +866,8 @@ class Usps
                                 'Priority Mail International Large Flat Rate Box',
                                 'Priority Mail International Medium Flat Rate Box',
                                 'Priority Mail International Small Flat Rate Box',
+                                'Priority Mail International DVD Flat Rate priced box',
+                                'Priority Mail International Large Video Flat Rate priced box'
                             )
                         )
                     )
@@ -745,15 +877,29 @@ class Usps
                     'filters'    => array(
                         'within_us' => array(
                             'method' => array(
-                                'Express Mail Flat Rate Envelope',
-                                'Express Mail Flat Rate Envelope Hold For Pickup',
                                 'Priority Mail Flat Rate Envelope',
+                                'Priority Mail Express Flat Rate Envelope',
+                                'Priority Mail Express Flat Rate Envelope Hold For Pickup',
+                                'Priority Mail Flat Rate Envelope',
+                                'First-Class Mail Large Envelope',
+                                'Priority Mail Flat Rate Envelope Hold For Pickup',
+                                'Priority Mail Small Flat Rate Envelope',
+                                'Priority Mail Small Flat Rate Envelope Hold For Pickup',
+                                'Priority Mail Express Sunday/Holiday Delivery Flat Rate Envelope',
+                                'Priority Mail Express Padded Flat Rate Envelope'
                             )
                         ),
                         'from_us' => array(
                             'method' => array(
-                                'Express Mail International Flat Rate Envelope',
+                                'Priority Mail Express International Flat Rate Envelope',
                                 'Priority Mail International Flat Rate Envelope',
+                                'First-Class Mail International Large Envelope',
+                                'Priority Mail International Small Flat Rate Envelope',
+                                'Priority Mail Express International Legal Flat Rate Envelope',
+                                'Priority Mail International Gift Card Flat Rate Envelope',
+                                'Priority Mail International Window Flat Rate Envelope',
+                                'Priority Mail International Legal Flat Rate Envelope',
+                                'Priority Mail Express International Padded Flat Rate Envelope',
                             )
                         )
                     )
@@ -763,19 +909,20 @@ class Usps
                     'filters'    => array(
                         'within_us' => array(
                             'method' => array(
-                                'Express Mail',
+                                'Priority Mail Express',
                                 'Priority Mail',
-                                'Parcel Post',
+                                'Standard Post',
                                 'Media Mail',
+                                'Library Mail',
+                                'First-Class Package Service'
                             )
                         ),
                         'from_us' => array(
                             'method' => array(
                                 'USPS GXG Envelopes',
-                                'Express Mail International',
+                                'Priority Mail Express International',
                                 'Priority Mail International',
-                                'First-Class Mail International Package',
-                                'First-Class Mail International Parcel',
+                                'First-Class Package International Service',
                             )
                         )
                     )
@@ -785,20 +932,19 @@ class Usps
                     'filters'    => array(
                         'within_us' => array(
                             'method' => array(
-                                'Express Mail',
+                                'Priority Mail Express',
                                 'Priority Mail',
-                                'Parcel Post',
+                                'Standard Post',
                                 'Media Mail',
+                                'Library Mail',
                             )
                         ),
                         'from_us' => array(
                             'method' => array(
                                 'Global Express Guaranteed (GXG)',
-                                'USPS GXG Envelopes',
-                                'Express Mail International',
+                                'Priority Mail Express International',
                                 'Priority Mail International',
-                                'First-Class Mail International Package',
-                                'First-Class Mail International Parcel',
+                                'First-Class Package International Service',
                             )
                         )
                     )
@@ -821,13 +967,6 @@ class Usps
             ),
         );
 
-        $methods = $this->getConfigData('methods');
-        if (!empty($methods)) {
-            $codes['method'] = explode(",", $methods);
-        } else {
-            $codes['method'] = array();
-        }
-
         if (!isset($codes[$type])) {
             return false;
         } elseif (''===$code) {
@@ -903,7 +1042,7 @@ class Usps
                 if (!$url) {
                     $url = $this->_defaultGatewayUrl;
                 }
-                $client = new \Zend_Http_Client();
+                $client = $this->_httpClientFactory->create();
                 $client->setUri($url);
                 $client->setConfig(array('maxredirects'=>0, 'timeout'=>30));
                 $client->setParameterGet('API', $api);
@@ -1016,7 +1155,7 @@ class Usps
         $allowed = explode(',', $this->getConfigData('allowed_methods'));
         $arr = array();
         foreach ($allowed as $k) {
-            $arr[$k] = $k;
+            $arr[$k] = $this->getCode('method', $k);
         }
         return $arr;
     }
@@ -1357,18 +1496,23 @@ class Usps
     {
         switch ($serviceType) {
             case 'PRIORITY':
+            case 'Priority':
                 $serviceType = 'Priority';
                 break;
             case 'FIRST CLASS':
+            case 'First Class':
                 $serviceType = 'First Class';
                 break;
-            case 'PARCEL':
-                $serviceType = 'Parcel Post';
+            case 'STANDARD':
+            case 'Standard Post':
+                $serviceType = 'Standard Post';
                 break;
             case 'MEDIA':
+            case 'Media':
                 $serviceType = 'Media Mail';
                 break;
             case 'LIBRARY':
+            case 'Library':
                 $serviceType = 'Library Mail';
                 break;
             default:
@@ -1515,11 +1659,12 @@ class Usps
             array('data' => '<?xml version = "1.0" encoding = "UTF-8"?><wrap/>')
         );
         $method = '';
-        if (stripos($shippingMethod, 'Priority') !== false) {
+        $service = $this->getCode('service_to_code', $shippingMethod);
+        if ($service == 'Priority') {
             $method = 'Priority';
             $rootNode = 'PriorityMailIntlRequest';
             $xml = $xmlWrap->addChild($rootNode);
-        } else if (stripos($shippingMethod, 'First-Class') !== false) {
+        } else if ($service == 'First Class') {
             $method = 'FirstClass';
             $rootNode = 'FirstClassMailIntlRequest';
             $xml = $xmlWrap->addChild($rootNode);
@@ -1554,7 +1699,8 @@ class Usps
             }
             $xml->addChild('FromCustomsReference', 'Order #' . $referenceData);
         }
-        $xml->addChild('ToName', $request->getRecipientContactPersonName());
+        $xml->addChild('ToFirstName', $request->getRecipientContactPersonFirstName());
+        $xml->addChild('ToLastName', $request->getRecipientContactPersonLastName());
         $xml->addChild('ToFirm', $request->getRecipientContactCompanyName());
         $xml->addChild('ToAddress1', $request->getRecipientAddressStreet1());
         $xml->addChild('ToAddress2', $request->getRecipientAddressStreet2());
@@ -1692,7 +1838,7 @@ class Usps
         $service = $this->getCode('service_to_code', $request->getShippingMethod());
         $recipientUSCountry = $this->_isUSCountry($request->getRecipientAddressCountryCode());
 
-        if ($recipientUSCountry && $service == 'EXPRESS') {
+        if ($recipientUSCountry && $service == 'Priority Express') {
             $requestXml = $this->_formUsExpressShipmentRequest($request);
             $api = 'ExpressMailLabel';
         } else if ($recipientUSCountry) {
@@ -1702,10 +1848,10 @@ class Usps
             } else {
                 $api = 'SignatureConfirmationCertifyV3';
             }
-        } else if ($service == 'FIRST CLASS') {
+        } else if ($service == 'First Class') {
             $requestXml = $this->_formIntlShipmentRequest($request);
             $api = 'FirstClassMailIntl';
-        } else if ($service == 'PRIORITY') {
+        } else if ($service == 'Priority') {
             $requestXml = $this->_formIntlShipmentRequest($request);
             $api = 'PriorityMailIntl';
         } else {
@@ -1718,7 +1864,7 @@ class Usps
         if (!$url) {
             $url = $this->_defaultGatewayUrl;
         }
-        $client = new \Zend_Http_Client();
+        $client = $this->_httpClientFactory->create();
         $client->setUri($url);
         $client->setConfig(array('maxredirects'=>0, 'timeout'=>30));
         $client->setParameterGet('API', $api);
@@ -1735,7 +1881,7 @@ class Usps
             $this->_debug($debugData);
             $result->setErrors($debugData['result']['error']);
         } else {
-            if ($recipientUSCountry && $service == 'EXPRESS') {
+            if ($recipientUSCountry && $service == 'Priority Express') {
                 $labelContent = base64_decode((string) $response->EMLabel);
                 $trackingNumber = (string) $response->EMConfirmationNumber;
             } else if ($recipientUSCountry) {
diff --git a/app/code/Magento/Usa/Model/Shipping/Carrier/Usps/Source/Generic.php b/app/code/Magento/Usa/Model/Shipping/Carrier/Usps/Source/Generic.php
index 57b9351cd39ed6592cccec23b37373a2615a4053..9fe45fceb3ebd49a61eb8c777c12e58d50fae6ca 100644
--- a/app/code/Magento/Usa/Model/Shipping/Carrier/Usps/Source/Generic.php
+++ b/app/code/Magento/Usa/Model/Shipping/Carrier/Usps/Source/Generic.php
@@ -55,8 +55,10 @@ class Generic implements \Magento\Core\Model\Option\ArrayInterface
     {
         $configData = $this->_shippingUsps->getCode($this->_code);
         $arr = array();
-        foreach ($configData as $code => $title) {
-            $arr[] = array('value' => $code, 'label' => $title);
+        if ($configData) {
+            foreach ($configData as $code => $title) {
+                $arr[] = array('value' => $code, 'label' => __($title));
+            }
         }
         return $arr;
     }
diff --git a/app/code/Magento/Usa/etc/config.xml b/app/code/Magento/Usa/etc/config.xml
index cd9e50b11a3f41c1c4886106f9187bfa123222a8..41ca00b43e4e1b68da4664283ecf44bbe3a4717c 100644
--- a/app/code/Magento/Usa/etc/config.xml
+++ b/app/code/Magento/Usa/etc/config.xml
@@ -117,7 +117,7 @@
             <usps>
                 <active>0</active>
                 <sallowspecific>0</sallowspecific>
-                <allowed_methods>Bound Printed Matter,Express Mail,Express Mail Flat Rate Envelope,Express Mail Flat Rate Envelope Hold For Pickup,Express Mail Flat-Rate Envelope Sunday/Holiday Guarantee,Express Mail Hold For Pickup,Express Mail International,Express Mail International Flat Rate Envelope,Express Mail PO to PO,Express Mail Sunday/Holiday Guarantee,First-Class Mail International Large Envelope,First-Class Mail International Letter,First-Class Mail International Package,First-Class Mail International Parcel,First-Class,First-Class Mail,First-Class Mail Flat,First-Class Mail Large Envelope,First-Class Mail International,First-Class Mail Letter,First-Class Mail Parcel,First-Class Mail Package,Global Express Guaranteed (GXG),Global Express Guaranteed Non-Document Non-Rectangular,Global Express Guaranteed Non-Document Rectangular,Library Mail,Media Mail,Parcel Post,Priority Mail,Priority Mail Small Flat Rate Box,Priority Mail Medium Flat Rate Box,Priority Mail Large Flat Rate Box,Priority Mail Flat Rate Box,Priority Mail Flat Rate Envelope,Priority Mail International,Priority Mail International Flat Rate Box,Priority Mail International Flat Rate Envelope,Priority Mail International Small Flat Rate Box,Priority Mail International Medium Flat Rate Box,Priority Mail International Large Flat Rate Box,USPS GXG Envelopes</allowed_methods>
+                <allowed_methods>0_FCLE,0_FCL,0_FCP,1,2,3,4,6,7,13,16,17,22,23,25,27,28,33,34,35,36,37,42,43,53,55,56,57,61,INT_1,INT_2,INT_4,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,INT_12,INT_13,INT_14,INT_15,INT_16,INT_20,INT_26</allowed_methods>
                 <container>VARIABLE</container>
                 <cutoff_cost />
                 <free_method />
@@ -126,7 +126,7 @@
                 <shipment_requesttype>0</shipment_requesttype>
                 <handling />
                 <machinable>true</machinable>
-                <methods>Bound Printed Matter,Express Mail,Express Mail Flat Rate Envelope,Express Mail Flat Rate Envelope Hold For Pickup,Express Mail Flat-Rate Envelope Sunday/Holiday Guarantee,Express Mail Hold For Pickup,Express Mail International,Express Mail International Flat Rate Envelope,Express Mail PO to PO,Express Mail Sunday/Holiday Guarantee,First-Class Mail International Large Envelope,First-Class Mail International Letters,First-Class Mail International Package,First-Class Mail International Parcel,First-Class,First-Class Mail,First-Class Mail Flat,First-Class Mail Large Envelope,First-Class Mail International,First-Class Mail Letter,First-Class Mail Parcel,First-Class Mail Package,Global Express Guaranteed (GXG),Global Express Guaranteed Non-Document Non-Rectangular,Global Express Guaranteed Non-Document Rectangular,Library Mail,Media Mail,Parcel Post,Priority Mail,Priority Mail Small Flat Rate Box,Priority Mail Medium Flat Rate Box,Priority Mail Large Flat Rate Box,Priority Mail Flat Rate Box,Priority Mail Flat Rate Envelope,Priority Mail International,Priority Mail International Flat Rate Box,Priority Mail International Flat Rate Envelope,Priority Mail International Small Flat Rate Box,Priority Mail International Medium Flat Rate Box,Priority Mail International Large Flat Rate Box,USPS GXG Envelopes</methods>
+                <methods></methods>
                 <model>Magento\Usa\Model\Shipping\Carrier\Usps</model>
                 <size>REGULAR</size>
                 <title>United States Postal Service</title>
diff --git a/app/code/Magento/Usa/i18n/en_US.csv b/app/code/Magento/Usa/i18n/en_US.csv
index 42ab0b679b36679de99bed8f4d50d499b0e63e9b..85c6c163a171fe1364bb20000feb9f1ee03f3a2b 100644
--- a/app/code/Magento/Usa/i18n/en_US.csv
+++ b/app/code/Magento/Usa/i18n/en_US.csv
@@ -44,6 +44,7 @@
 "Customer services","Customer services"
 "DHL","DHL"
 "DHL (Deprecated)","DHL (Deprecated)"
+"DHL service is not available at %s date","DHL service is not available at %s date"
 "Debug","Debug"
 "Default Package Height","Default Package Height"
 "Default Package Length","Default Package Length"
@@ -96,6 +97,17 @@
 "FedEx Tube","FedEx Tube"
 "First Overnight","First Overnight"
 "First-Class","First-Class"
+"First-Class Mail International Large Envelope","First-Class Mail International Large Envelope"
+"First-Class Mail International Letter","First-Class Mail International Letter"
+"First-Class Mail International Postcard","First-Class Mail International Postcard"
+"First-Class Mail Large Envelope","First-Class Mail Large Envelope"
+"First-Class Mail Large Postcards","First-Class Mail Large Postcards"
+"First-Class Mail Letter","First-Class Mail Letter"
+"First-Class Mail Parcel","First-Class Mail Parcel"
+"First-Class Mail Postcards","First-Class Mail Postcards"
+"First-Class Package International Service","First-Class Package International Service"
+"First-Class Package Service","First-Class Package Service"
+"First-Class Package Service Hold For Pickup","First-Class Package Service Hold For Pickup"
 "Flat","Flat"
 "Flat-Rate Box","Flat-Rate Box"
 "Flat-Rate Envelope","Flat-Rate Envelope"
@@ -107,6 +119,10 @@
 "Gateway XML URL","Gateway XML URL"
 "Gift","Gift"
 "Girth","Girth"
+"Global Express Guaranteed (GXG)","Global Express Guaranteed (GXG)"
+"Global Express Guaranteed Document","Global Express Guaranteed Document"
+"Global Express Guaranteed Non-Document Non-Rectangular","Global Express Guaranteed Non-Document Non-Rectangular"
+"Global Express Guaranteed Non-Document Rectangular","Global Express Guaranteed Non-Document Rectangular"
 "Globalmail business","Globalmail business"
 "Ground","Ground"
 "Ground Commercial","Ground Commercial"
@@ -136,6 +152,7 @@
 "Length","Length"
 "Letter","Letter"
 "Library","Library"
+"Library Mail","Library Mail"
 "Live","Live"
 "Machinable","Machinable"
 "Maximum Package Weight (Please consult your shipping carrier for maximum supported shipping weight)","Maximum Package Weight (Please consult your shipping carrier for maximum supported shipping weight)"
@@ -164,6 +181,7 @@
 "None","None"
 "Not Required","Not Required"
 "Order","Order"
+"Order #%s","Order #%s"
 "Origin of the Shipment","Origin of the Shipment"
 "Origin serviceAreaCode is missing","Origin serviceAreaCode is missing"
 "Other","Other"
@@ -171,6 +189,7 @@
 "PAK","PAK"
 "Package","Package"
 "Package Description","Package Description"
+"Package content is missing","Package content is missing"
 "Packages Request Type","Packages Request Type"
 "Packaging","Packaging"
 "Pallet","Pallet"
@@ -181,13 +200,72 @@
 "Piece Id barcode is missing","Piece Id barcode is missing"
 "Piece number information is missing","Piece number information is missing"
 "Please make sure to use only digits here. No dashes are allowed.","Please make sure to use only digits here. No dashes are allowed."
+"Please, specify origin country","Please, specify origin country"
 "Pounds","Pounds"
 "Priority Mail","Priority Mail"
+"Priority Mail Express","Priority Mail Express"
+"Priority Mail Express Flat Rate Boxes","Priority Mail Express Flat Rate Boxes"
+"Priority Mail Express Flat Rate Boxes Hold For Pickup","Priority Mail Express Flat Rate Boxes Hold For Pickup"
+"Priority Mail Express Flat Rate Envelope","Priority Mail Express Flat Rate Envelope"
+"Priority Mail Express Flat Rate Envelope Hold For Pickup","Priority Mail Express Flat Rate Envelope Hold For Pickup"
+"Priority Mail Express Hold For Pickup","Priority Mail Express Hold For Pickup"
+"Priority Mail Express International","Priority Mail Express International"
+"Priority Mail Express International Flat Rate Boxes","Priority Mail Express International Flat Rate Boxes"
+"Priority Mail Express International Flat Rate Envelope","Priority Mail Express International Flat Rate Envelope"
+"Priority Mail Express International Legal Flat Rate Envelope","Priority Mail Express International Legal Flat Rate Envelope"
+"Priority Mail Express International Padded Flat Rate Envelope","Priority Mail Express International Padded Flat Rate Envelope"
+"Priority Mail Express Legal Flat Rate Envelope","Priority Mail Express Legal Flat Rate Envelope"
+"Priority Mail Express Legal Flat Rate Envelope Hold For Pickup","Priority Mail Express Legal Flat Rate Envelope Hold For Pickup"
+"Priority Mail Express Padded Flat Rate Envelope","Priority Mail Express Padded Flat Rate Envelope"
+"Priority Mail Express Padded Flat Rate Envelope Hold For Pickup","Priority Mail Express Padded Flat Rate Envelope Hold For Pickup"
+"Priority Mail Express Sunday/Holiday Delivery","Priority Mail Express Sunday/Holiday Delivery"
+"Priority Mail Express Sunday/Holiday Delivery Flat Rate Boxes","Priority Mail Express Sunday/Holiday Delivery Flat Rate Boxes"
+"Priority Mail Express Sunday/Holiday Delivery Flat Rate Envelope","Priority Mail Express Sunday/Holiday Delivery Flat Rate Envelope"
+"Priority Mail Express Sunday/Holiday Delivery Legal Flat Rate Envelope","Priority Mail Express Sunday/Holiday Delivery Legal Flat Rate Envelope"
+"Priority Mail Express Sunday/Holiday Delivery Padded Flat Rate Envelope","Priority Mail Express Sunday/Holiday Delivery Padded Flat Rate Envelope"
+"Priority Mail Flat Rate Envelope","Priority Mail Flat Rate Envelope"
+"Priority Mail Flat Rate Envelope Hold For Pickup","Priority Mail Flat Rate Envelope Hold For Pickup"
+"Priority Mail Gift Card Flat Rate Envelope","Priority Mail Gift Card Flat Rate Envelope"
+"Priority Mail Gift Card Flat Rate Envelope Hold For Pickup","Priority Mail Gift Card Flat Rate Envelope Hold For Pickup"
+"Priority Mail Hold For Pickup","Priority Mail Hold For Pickup"
+"Priority Mail International","Priority Mail International"
+"Priority Mail International DVD Flat Rate priced box","Priority Mail International DVD Flat Rate priced box"
+"Priority Mail International Flat Rate Envelope","Priority Mail International Flat Rate Envelope"
+"Priority Mail International Gift Card Flat Rate Envelope","Priority Mail International Gift Card Flat Rate Envelope"
+"Priority Mail International Large Flat Rate Box","Priority Mail International Large Flat Rate Box"
+"Priority Mail International Large Video Flat Rate priced box","Priority Mail International Large Video Flat Rate priced box"
+"Priority Mail International Legal Flat Rate Envelope","Priority Mail International Legal Flat Rate Envelope"
+"Priority Mail International Medium Flat Rate Box","Priority Mail International Medium Flat Rate Box"
+"Priority Mail International Padded Flat Rate Envelope","Priority Mail International Padded Flat Rate Envelope"
+"Priority Mail International Small Flat Rate Box","Priority Mail International Small Flat Rate Box"
+"Priority Mail International Small Flat Rate Envelope","Priority Mail International Small Flat Rate Envelope"
+"Priority Mail International Window Flat Rate Envelope","Priority Mail International Window Flat Rate Envelope"
+"Priority Mail Large Flat Rate Box","Priority Mail Large Flat Rate Box"
+"Priority Mail Large Flat Rate Box Hold For Pickup","Priority Mail Large Flat Rate Box Hold For Pickup"
+"Priority Mail Legal Flat Rate Envelope","Priority Mail Legal Flat Rate Envelope"
+"Priority Mail Legal Flat Rate Envelope Hold For Pickup","Priority Mail Legal Flat Rate Envelope Hold For Pickup"
+"Priority Mail Medium Flat Rate Box","Priority Mail Medium Flat Rate Box"
+"Priority Mail Medium Flat Rate Box Hold For Pickup","Priority Mail Medium Flat Rate Box Hold For Pickup"
+"Priority Mail Padded Flat Rate Envelope","Priority Mail Padded Flat Rate Envelope"
+"Priority Mail Padded Flat Rate Envelope Hold For Pickup","Priority Mail Padded Flat Rate Envelope Hold For Pickup"
+"Priority Mail Regional Rate Box A","Priority Mail Regional Rate Box A"
+"Priority Mail Regional Rate Box A Hold For Pickup","Priority Mail Regional Rate Box A Hold For Pickup"
+"Priority Mail Regional Rate Box B","Priority Mail Regional Rate Box B"
+"Priority Mail Regional Rate Box B Hold For Pickup","Priority Mail Regional Rate Box B Hold For Pickup"
+"Priority Mail Regional Rate Box C","Priority Mail Regional Rate Box C"
+"Priority Mail Regional Rate Box C Hold For Pickup","Priority Mail Regional Rate Box C Hold For Pickup"
+"Priority Mail Small Flat Rate Box","Priority Mail Small Flat Rate Box"
+"Priority Mail Small Flat Rate Box Hold For Pickup","Priority Mail Small Flat Rate Box Hold For Pickup"
+"Priority Mail Small Flat Rate Envelope","Priority Mail Small Flat Rate Envelope"
+"Priority Mail Small Flat Rate Envelope Hold For Pickup","Priority Mail Small Flat Rate Envelope Hold For Pickup"
+"Priority Mail Window Flat Rate Envelope","Priority Mail Window Flat Rate Envelope"
+"Priority Mail Window Flat Rate Envelope Hold For Pickup","Priority Mail Window Flat Rate Envelope Hold For Pickup"
 "Priority Overnight","Priority Overnight"
 "Product content code is invalid","Product content code is invalid"
 "Product name is missing","Product name is missing"
 "Receiver","Receiver"
 "Rectangular","Rectangular"
+"Reference code is missing","Reference code is missing"
 "Regular","Regular"
 "Regular Pickup","Regular Pickup"
 "Request Courier","Request Courier"
@@ -219,6 +297,8 @@
 "Shipment is not available.","Shipment is not available."
 "Shipment picked up","Shipment picked up"
 "Shipper Number","Shipper Number"
+"Shipping Accept XML URL","Shipping Accept XML URL"
+"Shipping Confirm XML URL","Shipping Confirm XML URL"
 "Shipping Key","Shipping Key"
 "Shipping Key (International)","Shipping Key (International)"
 "Show Method if Not Applicable","Show Method if Not Applicable"
@@ -230,6 +310,7 @@
 "Specific","Specific"
 "Sprintline","Sprintline"
 "Standard Overnight","Standard Overnight"
+"Standard Post","Standard Post"
 "Station","Station"
 "Subtotal","Subtotal"
 "Subtotal With Discount","Subtotal With Discount"
@@ -273,6 +354,7 @@
 "UPS Worldwide Express PlusSM","UPS Worldwide Express PlusSM"
 "UPS Worldwide Saver","UPS Worldwide Saver"
 "USPS","USPS"
+"USPS GXG Envelopes","USPS GXG Envelopes"
 "Unable to retrieve tracking","Unable to retrieve tracking"
 "United Parcel Service","United Parcel Service"
 "United Parcel Service XML","United Parcel Service XML"
@@ -296,4 +378,4 @@
 "Your Packaging","Your Packaging"
 "Zero shipping charge for '%s'","Zero shipping charge for '%s'"
 "cm","cm"
-"inch","inch"
+"inch","inch"
\ No newline at end of file
diff --git a/app/code/Magento/Weee/view/adminhtml/renderer/tax.phtml b/app/code/Magento/Weee/view/adminhtml/renderer/tax.phtml
index 9295580d39d108f783f564c6d637265355841cb6..ca0ae9530bbecc0b5b53b53052b9c001d8bf6410 100644
--- a/app/code/Magento/Weee/view/adminhtml/renderer/tax.phtml
+++ b/app/code/Magento/Weee/view/adminhtml/renderer/tax.phtml
@@ -37,25 +37,26 @@
     <div class="control">
         <table class="data-table" cellspacing="0">
             <thead>
-            <tr class="headings">
-                <th <?php if (!$this->isMultiWebsites()): ?>style="display:none"<?php endif; ?>><?php echo __('Website') ?></th>
-                <th><?php echo __('Country/State') ?><span class="required">*</span></th>
-                <th><?php echo __('Tax') ?><span class="required">*</span></th>
-                <th><?php echo __('Action') ?></th>
-            </tr>
+                <tr>
+                    <th class="col-website" <?php if (!$this->isMultiWebsites()): ?>style="display: none;"<?php endif; ?>><?php echo __('Website'); ?></th>
+                    <th class="col-country required"><?php echo __('Country/State'); ?></th>
+                    <th class="col-tax required"><?php echo __('Tax'); ?></th>
+                    <th class="col-action"><?php echo __('Action'); ?></th>
+                </tr>
             </thead>
-            <tbody data-role="fpt-item-container">
-            </tbody>
             <tfoot>
-            <tr>
-                <td colspan="4"><?php echo $this->getAddButtonHtml() ?></td>
-            </tr>
+                <tr>
+                    <td colspan="4"><?php echo $this->getAddButtonHtml(); ?></td>
+                </tr>
             </tfoot>
+            <tbody data-role="fpt-item-container" class="fpt-item-container">
+            </tbody>
         </table>
     </div>
+
     <script data-role="row-template" type="text/x-jquery-tmpl">
         <tr id="<?php echo $this->getElement()->getHtmlId() ?>_weee_tax_row_${index}" data-role="fpt-item-row">
-            <td <?php if (!$this->isMultiWebsites()): ?>style="display: none"<?php endif; ?>>
+            <td class="col-website" <?php if (!$this->isMultiWebsites()): ?>style="display: none"<?php endif; ?>>
                 <select name="<?php echo $this->getElement()->getName() ?>[${index}][website_id]"
                         class="<?php echo $this->getElement()->getClass() ?> website required-entry" data-role="select-website">
                     <?php foreach ($this->getWebsites() as $_websiteId => $_info): ?>
@@ -63,7 +64,7 @@
                     <?php endforeach ?>
                 </select>
             </td>
-            <td>
+            <td class="col-country">
                 <select id="<?php echo $this->getElement()->getName() ?>_weee_tax_row_${index}_country"
                         name="<?php echo $this->getElement()->getName() ?>[${index}][country]"
                         class="<?php echo $this->getElement()->getClass() ?> country required-entry" data-role="select-country">
@@ -77,12 +78,12 @@
                     <option value="0">*</option>
                 </select>
             </td>
-            <td>
+            <td class="col-tax">
                 <input name="<?php echo $this->getElement()->getName() ?>[${index}][price]"
                        class="<?php echo $this->getElement()->getClass() ?> required-entry validate-greater-than-zero"
                        type="text" value="${value}"/>
             </td>
-            <td>
+            <td class="col-action">
                 <input name="<?php echo $this->getElement()->getName() ?>[${index}][delete]" class="delete" type="hidden" value="" data-role="delete-fpt-item"/>
                 <?php echo $this->getChildHtml('delete_button') ?>
             </td>
diff --git a/app/code/Magento/Widget/Model/Config/FileResolver.php b/app/code/Magento/Widget/Model/Config/FileResolver.php
index 7852d8ece981137d1d456ed7c08dc9b2ae13d918..d426dc192e4414b8092c3f83956f6ff5fba4bfb6 100644
--- a/app/code/Magento/Widget/Model/Config/FileResolver.php
+++ b/app/code/Magento/Widget/Model/Config/FileResolver.php
@@ -58,7 +58,7 @@ class FileResolver implements \Magento\Config\FileResolverInterface
         \Magento\Filesystem                 $filesystem,
         \Magento\Module\Dir\Reader          $moduleReader,
         \Magento\Config\FileIteratorFactory $iteratorFactory
-    ){
+    ) {
         $this->themesDirectory  = $filesystem->getDirectoryRead(\Magento\Filesystem::THEMES);
         $this->modulesDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::MODULES);
         $this->iteratorFactory  = $iteratorFactory;
@@ -75,8 +75,10 @@ class FileResolver implements \Magento\Config\FileResolverInterface
                 $iterator = $this->_moduleReader->getConfigurationFiles($filename);
                 break;
             case 'design':
-                $fileList = $this->themesDirectory->search('#/' . preg_quote($filename) . '$#');
-                $iterator = $this->iteratorFactory->create($this->themesDirectory, $fileList);
+                $iterator = $this->iteratorFactory->create(
+                    $this->themesDirectory,
+                    $this->themesDirectory->search('/*/*/etc/' . $filename)
+                );
                 break;
             default:
                 $iterator = $this->iteratorFactory->create($this->themesDirectory, array());;
diff --git a/app/code/Magento/Wishlist/Block/AbstractBlock.php b/app/code/Magento/Wishlist/Block/AbstractBlock.php
index ea5b305365b63ca73b2027591c512e59764f9a0b..167057741a713554525327470f854bdfe156a124 100644
--- a/app/code/Magento/Wishlist/Block/AbstractBlock.php
+++ b/app/code/Magento/Wishlist/Block/AbstractBlock.php
@@ -50,20 +50,6 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd
      */
     protected $_wishlist;
 
-    /**
-     * List of block settings to render prices for different product types
-     *
-     * @var array
-     */
-    protected $_itemPriceBlockTypes = array();
-
-    /**
-     * List of block instances to render prices for different product types
-     *
-     * @var array
-     */
-    protected $_cachedItemPriceBlocks = array();
-
     /**
      * @var \Magento\Customer\Model\Session
      */
@@ -126,20 +112,6 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd
         );
     }
 
-    /**
-     * Internal constructor, that is called from real constructor
-     *
-     */
-    protected function _construct()
-    {
-        parent::_construct();
-        $this->addItemPriceBlockType(
-            'default',
-            'Magento\Wishlist\Block\Render\Item\Price',
-            'render/item/price.phtml'
-        );
-    }
-
     /**
      * Retrieve Wishlist Data Helper
      *
@@ -368,45 +340,6 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd
         return $this->getWishlistItemsCount() > 0;
     }
 
-    /**
-     * Adds special block to render price for item with specific product type
-     *
-     * @param string $type
-     * @param string $block
-     * @param string $template
-     */
-    public function addItemPriceBlockType($type, $block = '', $template = '')
-    {
-        if ($type) {
-            $this->_itemPriceBlockTypes[$type] = array(
-                'block' => $block,
-                'template' => $template
-            );
-        }
-    }
-
-    /**
-     * Returns block to render item with some product type
-     *
-     * @param string $productType
-     * @return \Magento\View\Element\Template
-     */
-    protected function _getItemPriceBlock($productType)
-    {
-        if (!isset($this->_itemPriceBlockTypes[$productType])) {
-            $productType = 'default';
-        }
-
-        if (!isset($this->_cachedItemPriceBlocks[$productType])) {
-            $blockType = $this->_itemPriceBlockTypes[$productType]['block'];
-            $template = $this->_itemPriceBlockTypes[$productType]['template'];
-            $block = $this->getLayout()->createBlock($blockType)
-                ->setTemplate($template);
-            $this->_cachedItemPriceBlocks[$productType] = $block;
-        }
-        return $this->_cachedItemPriceBlocks[$productType];
-    }
-
     /**
      * Returns product price block html
      * Overwrites parent price html return to be ready to show configured, partially configured and
diff --git a/app/code/Magento/Wishlist/Block/Customer/Sidebar.php b/app/code/Magento/Wishlist/Block/Customer/Sidebar.php
index 3c5c9dad6bdf8f68be65ee6c404a75e666c4d8a6..93d0f991be5ac5260eda5c58fd31f5ceb62f0c8d 100644
--- a/app/code/Magento/Wishlist/Block/Customer/Sidebar.php
+++ b/app/code/Magento/Wishlist/Block/Customer/Sidebar.php
@@ -43,7 +43,7 @@ class Sidebar extends \Magento\Wishlist\Block\AbstractBlock
      */
     public function getTitle()
     {
-        return __('My Wish List <small>(%1)</small>', $this->getItemCount());
+        return __('My Wish List');
     }
 
     /**
diff --git a/app/code/Magento/Wishlist/Block/Customer/Wishlist.php b/app/code/Magento/Wishlist/Block/Customer/Wishlist.php
index 8d318c965bed235d8632c933115aa51629ee30dc..1ce35f1dce8b025648bf0697f7341f0ff724bded 100644
--- a/app/code/Magento/Wishlist/Block/Customer/Wishlist.php
+++ b/app/code/Magento/Wishlist/Block/Customer/Wishlist.php
@@ -41,6 +41,11 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock
      */
     protected $_helperPool;
 
+    /**
+     * @var \Magento\Data\Form\FormKey
+     */
+    protected $_formKey;
+
     /**
      * @param \Magento\View\Element\Template\Context $context
      * @param \Magento\Catalog\Model\Config $catalogConfig
@@ -56,8 +61,9 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock
      * @param \Magento\Customer\Model\Session $customerSession
      * @param \Magento\Catalog\Model\ProductFactory $productFactory
      * @param \Magento\Catalog\Helper\Product\ConfigurationPool $helperPool
+     * @param \Magento\Data\Form\FormKey $formKey
      * @param array $data
-     * 
+     *
      * @SuppressWarnings(PHPMD.ExcessiveParameterList)
      */
     public function __construct(
@@ -75,8 +81,10 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock
         \Magento\Customer\Model\Session $customerSession,
         \Magento\Catalog\Model\ProductFactory $productFactory,
         \Magento\Catalog\Helper\Product\ConfigurationPool $helperPool,
+        \Magento\Data\Form\FormKey $formKey,
         array $data = array()
     ) {
+        $this->_formKey = $formKey;
         $this->_helperPool = $helperPool;
         parent::__construct(
             $context,
@@ -235,4 +243,19 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock
         $qty = $this->getQty($item);
         return $qty ? $qty : 1;
     }
+
+    /**
+     * Get add all to cart url
+     * @return string
+     */
+    public function getAddAllToCartUrl()
+    {
+        return $this->getUrl(
+            '*/*/allcart',
+            array(
+                'wishlist_id' => $this->getWishlistInstance()->getId(),
+                'form_key' => $this->_formKey->getFormKey(),
+            )
+        );
+    }
 }
diff --git a/app/code/Magento/Wishlist/Block/Link.php b/app/code/Magento/Wishlist/Block/Link.php
index defd33a1ffed9070cb88d480923b1f6a9737e9a7..acb9e1880a7e659ab61bb6166d54232cd4fdde31 100644
--- a/app/code/Magento/Wishlist/Block/Link.php
+++ b/app/code/Magento/Wishlist/Block/Link.php
@@ -29,6 +29,13 @@ namespace Magento\Wishlist\Block;
 
 class Link extends \Magento\View\Element\Html\Link
 {
+    /**
+     * Template name
+     *
+     * @var string
+     */
+    protected $_template = 'Magento_Wishlist::link.phtml';
+
     /**
      * @var \Magento\Wishlist\Helper\Data
      */
@@ -72,7 +79,7 @@ class Link extends \Magento\View\Element\Html\Link
      */
     public function getLabel()
     {
-        return $this->_createLabel($this->_getItemCount());
+        return __('My Wish List');
     }
 
     /**
@@ -80,7 +87,15 @@ class Link extends \Magento\View\Element\Html\Link
      */
     public function getTitle()
     {
-        return $this->_createLabel($this->_getItemCount());
+        return $this->getLabel();
+    }
+
+    /**
+     * @return string
+     */
+    public function getCounter()
+    {
+        return $this->_createCounter($this->_getItemCount());
     }
 
     /**
@@ -99,14 +114,14 @@ class Link extends \Magento\View\Element\Html\Link
      * @param int $count
      * @return string
      */
-    protected function _createLabel($count)
+    protected function _createCounter($count)
     {
         if ($count > 1) {
-            return __('My Wish List (%1 items)', $count);
+            return __('%1 items', $count);
         } else if ($count == 1) {
-            return __('My Wish List (%1 item)', $count);
+            return __('1 item');
         } else {
-            return __('My Wish List');
+            return;
         }
     }
 }
diff --git a/app/code/Magento/Wishlist/Controller/AbstractController.php b/app/code/Magento/Wishlist/Controller/AbstractController.php
index 371e4398ec7844939f1ad2a83f75569feb223e52..2fdddfe635912e88f59dc8629c6747ebe6b2b28c 100644
--- a/app/code/Magento/Wishlist/Controller/AbstractController.php
+++ b/app/code/Magento/Wishlist/Controller/AbstractController.php
@@ -34,6 +34,8 @@
  */
 namespace Magento\Wishlist\Controller;
 
+use Magento\App\Action\Context;
+
 abstract class AbstractController extends \Magento\App\Action\Action
 {
     /**
@@ -42,6 +44,23 @@ abstract class AbstractController extends \Magento\App\Action\Action
      */
     protected $_localFilter = null;
 
+    /**
+     * @var \Magento\Core\App\Action\FormKeyValidator
+     */
+    protected $_formKeyValidator;
+
+    /**
+     * @param Context $context
+     * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
+     */
+    public function __construct(
+        \Magento\App\Action\Context $context,
+        \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
+    ) {
+        $this->_formKeyValidator = $formKeyValidator;
+        parent::__construct($context);
+    }
+
     /**
      * Processes localized qty (entered by user at frontend) into internal php format
      *
@@ -71,10 +90,14 @@ abstract class AbstractController extends \Magento\App\Action\Action
 
     /**
      * Add all items from wishlist to shopping cart
-     *
      */
     public function allcartAction()
     {
+        if (!$this->_formKeyValidator->validate($this->getRequest())) {
+            $this->_forward('noroute');
+            return ;
+        }
+
         $wishlist   = $this->_getWishlist();
         if (!$wishlist) {
             $this->_forward('noroute');
diff --git a/app/code/Magento/Wishlist/Controller/Index.php b/app/code/Magento/Wishlist/Controller/Index.php
index dd3eff6aef369d8917a0c8c5a69d0d01d978d59f..d6adf8cac50fadbfeb046d9173571439e796e6af 100644
--- a/app/code/Magento/Wishlist/Controller/Index.php
+++ b/app/code/Magento/Wishlist/Controller/Index.php
@@ -65,30 +65,24 @@ class Index
      */
     protected $_coreRegistry;
 
-    /**
-     * @var \Magento\Core\App\Action\FormKeyValidator
-     */
-    protected $_formKeyValidator;
-
     /**
      * @param \Magento\App\Action\Context $context
+     * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
      * @param \Magento\Core\Model\Registry $coreRegistry
      * @param \Magento\Wishlist\Model\Config $wishlistConfig
      * @param \Magento\App\Response\Http\FileFactory $fileResponseFactory
-     * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
      */
     public function __construct(
         \Magento\App\Action\Context $context,
+        \Magento\Core\App\Action\FormKeyValidator $formKeyValidator,
         \Magento\Core\Model\Registry $coreRegistry,
         \Magento\Wishlist\Model\Config $wishlistConfig,
-        \Magento\App\Response\Http\FileFactory $fileResponseFactory,
-        \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
+        \Magento\App\Response\Http\FileFactory $fileResponseFactory
     ) {
         $this->_coreRegistry = $coreRegistry;
         $this->_wishlistConfig = $wishlistConfig;
         $this->_fileResponseFactory = $fileResponseFactory;
-        $this->_formKeyValidator = $formKeyValidator;
-        parent::__construct($context);
+        parent::__construct($context, $formKeyValidator);
     }
 
     /**
diff --git a/app/code/Magento/Wishlist/Controller/Shared.php b/app/code/Magento/Wishlist/Controller/Shared.php
index f1827de7b0bbb8317e873284c4590114dafe992a..24f6fb30fc46984a5a0c46503bec25cd042e93a8 100644
--- a/app/code/Magento/Wishlist/Controller/Shared.php
+++ b/app/code/Magento/Wishlist/Controller/Shared.php
@@ -45,14 +45,16 @@ class Shared extends \Magento\Wishlist\Controller\AbstractController
 
     /**
      * @param \Magento\App\Action\Context $context
+     * @param \Magento\Core\App\Action\FormKeyValidator $formKeyValidator
      * @param \Magento\Core\Model\Registry $coreRegistry
      */
     public function __construct(
         \Magento\App\Action\Context $context,
+        \Magento\Core\App\Action\FormKeyValidator $formKeyValidator,
         \Magento\Core\Model\Registry $coreRegistry
     ) {
         $this->_coreRegistry = $coreRegistry;
-        parent::__construct($context);
+        parent::__construct($context, $formKeyValidator);
     }
 
     /**
diff --git a/app/code/Magento/Wishlist/Helper/Data.php b/app/code/Magento/Wishlist/Helper/Data.php
index 7b23d60ddc7c6d05d5b562a7c78519912d62ed07..b1ed0f58dfeac11753e7a34f0c80242c6d5b30bd 100644
--- a/app/code/Magento/Wishlist/Helper/Data.php
+++ b/app/code/Magento/Wishlist/Helper/Data.php
@@ -398,7 +398,7 @@ class Data extends \Magento\App\Helper\AbstractHelper
     }
 
     /**
-     * Retrieve URL for adding item to shoping cart from shared wishlist
+     * Retrieve URL for adding item to shopping cart from shared wishlist
      *
      * @param string|\Magento\Catalog\Model\Product|\Magento\Wishlist\Model\Item $item
      * @return  string
diff --git a/app/code/Magento/Wishlist/view/email/share_notification.html b/app/code/Magento/Wishlist/view/email/share_notification.html
index 399b85755c2e0722e981a7daf9a91db2a3d2ff64..386e494b723c7eba71bf19eade069a7921f24b8f 100644
--- a/app/code/Magento/Wishlist/view/email/share_notification.html
+++ b/app/code/Magento/Wishlist/view/email/share_notification.html
@@ -29,7 +29,7 @@ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif;
                         <p style="font-size:12px; line-height:16px; margin:0 0 16px 0;">{{var message}}</p>
                         {{var items}}
                         <br/>
-                        {{depend salable}}<p style="font-size:12px; line-height:16px; margin:0 0 8px 0;"><strong><a href="{{var addAllLink}}" style="color:#1E7EC8;">Add all items to shopping cart</a></strong> |{{/depend}} <strong><a href="{{var viewOnSiteLink}}" style="color:#1E7EC8;">View all wishlist items</a></strong></p>
+                        <p style="font-size:12px; line-height:16px; margin:0 0 8px 0;">{{depend salable}}<strong><a href="{{var addAllLink}}" style="color:#1E7EC8;">Add all items to shopping cart</a></strong> |{{/depend}} <strong><a href="{{var viewOnSiteLink}}" style="color:#1E7EC8;">View all wishlist items</a></strong></p>
                     </td>
                 </tr>
                 <tr>
diff --git a/app/code/Magento/Wishlist/view/frontend/item/column/cart.phtml b/app/code/Magento/Wishlist/view/frontend/item/column/cart.phtml
index 52a7d61f4c43fde2c9b0ca67659ecd01c4279742..bddec992a91690b957806aad4b90d23bfaca14c0 100644
--- a/app/code/Magento/Wishlist/view/frontend/item/column/cart.phtml
+++ b/app/code/Magento/Wishlist/view/frontend/item/column/cart.phtml
@@ -34,7 +34,7 @@ $options = $this->getChildBlock('customer.wishlist.item.options')
 <?php echo $this->getPriceHtml($product, empty($options));?>
 <div class="box tocart">
     <?php if ($item->canHaveQty() && $item->getProduct()->isVisibleInSiteVisibility()): ?>
-        <input type="text" class="input-text qty" data-validate="{required:true,'validate-greater-than-zero':true}"
+        <input type="number" class="input-text qty" data-validate="{required:true,'validate-greater-than-zero':true}"
                name="qty[<?php echo $item->getId() ?>]" value="<?php echo $this->getAddToCartQty($item) * 1 ?>">
     <?php endif; ?>
     <?php if ($product->isSaleable()): ?>
diff --git a/app/code/Magento/Wishlist/view/frontend/layout/default.xml b/app/code/Magento/Wishlist/view/frontend/layout/default.xml
index c84c1ec70ab10b02bc31e348fd84763a8e46a9f9..0c642530fc1e1117e0a16936cab7ddc89153cf80 100644
--- a/app/code/Magento/Wishlist/view/frontend/layout/default.xml
+++ b/app/code/Magento/Wishlist/view/frontend/layout/default.xml
@@ -28,6 +28,6 @@
         <block class="Magento\Wishlist\Block\Link" name="wish-list-link" after="my-account-link"/>
     </referenceBlock>
     <referenceContainer name="right">
-        <block class="Magento\Wishlist\Block\Customer\Sidebar" name="wishlist_sidebar" as="wishlist" after="cart_sidebar" template="sidebar.phtml"/>
+        <block class="Magento\Wishlist\Block\Customer\Sidebar" name="wishlist_sidebar" as="wishlist" template="Magento_Wishlist::sidebar.phtml"/>
     </referenceContainer>
 </layout>
diff --git a/app/code/Magento/Wishlist/view/frontend/render/item/price.phtml b/app/code/Magento/Wishlist/view/frontend/link.phtml
similarity index 60%
rename from app/code/Magento/Wishlist/view/frontend/render/item/price.phtml
rename to app/code/Magento/Wishlist/view/frontend/link.phtml
index fba1c3b9b9352c1c513c79cee648a23d0fe7a223..3b0ef5962b64ab91c4a0cc8306f01dbbf2712e4f 100644
--- a/app/code/Magento/Wishlist/view/frontend/render/item/price.phtml
+++ b/app/code/Magento/Wishlist/view/frontend/link.phtml
@@ -19,21 +19,13 @@
  * needs please refer to http://www.magentocommerce.com for more information.
  *
  * @category    design
- * @package     base_default
  * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
  * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
  */
-/* @var $this \Magento\Wishlist\Block\Customer\Wishlist_Render_Item_Price */
+/* @var $this \Magento\Wishlist\Block\Link */
 ?>
-
-<?php echo $this->getCleanProductPriceHtml(); ?>
-
-<?php /* @var $product \Magento\Catalog\Model\Product */ ?>
-<?php $product = $this->getProduct(); ?>
-<?php $finalPrice = $product->getFinalPrice(1); ?>
-<?php if ($product->canConfigure()): ?>
-    <p class="configured-price">
-        <span class="price-label"><?php echo __('Configured Price:') ?></span>
-        <span class="price"><?php echo $this->helper('Magento\Core\Helper\Data')->currency($finalPrice, true, false); ?></span>
-    </p>
-<?php endif; ?>
+<li class="link wishlist">
+    <a <?php echo $this->getLinkAttributes() ?>><?php echo $this->escapeHtml($this->getLabel())?>
+        <?php echo ($this->getCounter()) ? '<span class="counter qty">' . $this->escapeHtml($this->getCounter()) . '</span>' : ''; ?>
+    </a>
+</li>
diff --git a/app/code/Magento/Wishlist/view/frontend/sidebar.phtml b/app/code/Magento/Wishlist/view/frontend/sidebar.phtml
index 426803cf14f815ffcd0c707448061d3c02a0780c..8490da6877b57366510f560f37a934821ec53157 100644
--- a/app/code/Magento/Wishlist/view/frontend/sidebar.phtml
+++ b/app/code/Magento/Wishlist/view/frontend/sidebar.phtml
@@ -24,12 +24,18 @@
  */
 /* @var $this \Magento\Wishlist\Block\Customer\Sidebar */
 ?>
-
+<?php
+$count = $this->getItemCount();
+?>
 <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()) : ?>
     <?php $imageBlock =  $this->getLayout()->createBlock('Magento\Catalog\Block\Product\Image');?>
     <div class="block wishlist">
         <div class="title">
-            <strong><?php echo $this->getTitle(); ?></strong>
+            <strong><?php echo $this->getTitle(); ?>
+            <?php if($count > 0): ?>
+                <span class="counter qty"><?php echo ($count == 1) ? __('1 item') : __('%1 items',$count) ?></span>
+            <?php endif; ?>
+            </strong>
         </div>
         <div class="content">
             <strong class="subtitle"><?php echo __('Last Added Items') ?></strong>
@@ -65,7 +71,7 @@
                     <a class="action details" href="<?php echo $this->helper('Magento\Wishlist\Helper\Data')->getListUrl() ?>"><span><?php echo __('Go to Wish List') ?></span></a>
                 </div>
             <?php else: ?>
-                <p class="empty"><?php echo __('You have no items in your wish list.') ?></p>
+                <p class="message info empty"><?php echo __('You have no items in your wish list.') ?></p>
             <?php endif ?>
         </div>
     </div>
diff --git a/app/code/Magento/Wishlist/view/frontend/view.phtml b/app/code/Magento/Wishlist/view/frontend/view.phtml
index e564596675f8f74ec2b232cae95b526095fd4d39..3a5d73202513abad7fcccdb1cb854315b7e48e05 100644
--- a/app/code/Magento/Wishlist/view/frontend/view.phtml
+++ b/app/code/Magento/Wishlist/view/frontend/view.phtml
@@ -75,7 +75,7 @@
                         infoList: false,
                         addToCartUrl: '<?php echo $this->getItemAddToCartUrl('%item%');?>' ,
                         confirmRemoveMessage: '<?php echo __('Are you sure you want to remove this product from your wishlist?') ?>',
-                        addAllToCartUrl : '<?php echo $this->getUrl('*/*/allcart', array('wishlist_id' => $this->getWishlistInstance()->getId())) ?>',
+                        addAllToCartUrl : '<?php echo $this->getAddAllToCartUrl(); ?>',
                         commentString : ''
                     });
                 });
diff --git a/app/design/adminhtml/magento_backend/css/styles.css b/app/design/adminhtml/magento_backend/css/styles.css
index faccd991c812bec0cbc7ed73c52d36aaf65042cb..24122c17831809f18c24accbbff85f54c3002aca 100644
--- a/app/design/adminhtml/magento_backend/css/styles.css
+++ b/app/design/adminhtml/magento_backend/css/styles.css
@@ -172,9 +172,11 @@ button.primary,
 .catalog-product-new .actions-split > .action-toggle.primary,
 .catalog-product-edit .actions-split > .action-toggle.primary,
 .catalog-product-index .actions-split > .action-toggle.primary,
+.adminhtml-integration-new .actions-split > .action-toggle.primary,
 .catalog-product-new .actions-split.btn-round .action-default.primary,
 .catalog-product-edit .actions-split.btn-round .action-default.primary,
-.catalog-product-index .actions-split.btn-round .action-default.primary {
+.catalog-product-index .actions-split.btn-round .action-default.primary,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary {
   font: 14px/19px 'Open Sans', sans-serif;
   font-weight: 500;
   background: #f2ebde;
@@ -367,6 +369,9 @@ button.primary:active,
 .catalog-product-index .actions-split > .action-toggle.primary:hover,
 .catalog-product-index .actions-split > .action-toggle.primary:focus,
 .catalog-product-index .actions-split > .action-toggle.primary:active,
+.adminhtml-integration-new .actions-split > .action-toggle.primary:hover,
+.adminhtml-integration-new .actions-split > .action-toggle.primary:focus,
+.adminhtml-integration-new .actions-split > .action-toggle.primary:active,
 .catalog-product-new .actions-split.btn-round .action-default.primary:hover,
 .catalog-product-new .actions-split.btn-round .action-default.primary:focus,
 .catalog-product-new .actions-split.btn-round .action-default.primary:active,
@@ -375,7 +380,10 @@ button.primary:active,
 .catalog-product-edit .actions-split.btn-round .action-default.primary:active,
 .catalog-product-index .actions-split.btn-round .action-default.primary:hover,
 .catalog-product-index .actions-split.btn-round .action-default.primary:focus,
-.catalog-product-index .actions-split.btn-round .action-default.primary:active {
+.catalog-product-index .actions-split.btn-round .action-default.primary:active,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary:hover,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary:focus,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary:active {
   background: #cac3b4;
   color: #676056;
 }
@@ -437,9 +445,11 @@ button.primary:active,
 .catalog-product-new .actions-split > .action-toggle.primary:active,
 .catalog-product-edit .actions-split > .action-toggle.primary:active,
 .catalog-product-index .actions-split > .action-toggle.primary:active,
+.adminhtml-integration-new .actions-split > .action-toggle.primary:active,
 .catalog-product-new .actions-split.btn-round .action-default.primary:active,
 .catalog-product-edit .actions-split.btn-round .action-default.primary:active,
-.catalog-product-index .actions-split.btn-round .action-default.primary:active {
+.catalog-product-index .actions-split.btn-round .action-default.primary:active,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary:active {
   border: 1px solid #989287;
 }
 .DefaultButton:visited,
@@ -500,9 +510,11 @@ button.primary:visited,
 .catalog-product-new .actions-split > .action-toggle.primary:visited,
 .catalog-product-edit .actions-split > .action-toggle.primary:visited,
 .catalog-product-index .actions-split > .action-toggle.primary:visited,
+.adminhtml-integration-new .actions-split > .action-toggle.primary:visited,
 .catalog-product-new .actions-split.btn-round .action-default.primary:visited,
 .catalog-product-edit .actions-split.btn-round .action-default.primary:visited,
-.catalog-product-index .actions-split.btn-round .action-default.primary:visited {
+.catalog-product-index .actions-split.btn-round .action-default.primary:visited,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary:visited {
   color: #676056;
 }
 .DefaultButton[disabled],
@@ -621,12 +633,16 @@ button.primary.disabled,
 .catalog-product-edit .actions-split > .action-toggle.primary.disabled,
 .catalog-product-index .actions-split > .action-toggle.primary[disabled],
 .catalog-product-index .actions-split > .action-toggle.primary.disabled,
+.adminhtml-integration-new .actions-split > .action-toggle.primary[disabled],
+.adminhtml-integration-new .actions-split > .action-toggle.primary.disabled,
 .catalog-product-new .actions-split.btn-round .action-default.primary[disabled],
 .catalog-product-new .actions-split.btn-round .action-default.primary.disabled,
 .catalog-product-edit .actions-split.btn-round .action-default.primary[disabled],
 .catalog-product-edit .actions-split.btn-round .action-default.primary.disabled,
 .catalog-product-index .actions-split.btn-round .action-default.primary[disabled],
-.catalog-product-index .actions-split.btn-round .action-default.primary.disabled {
+.catalog-product-index .actions-split.btn-round .action-default.primary.disabled,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary[disabled],
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary.disabled {
   cursor: not-allowed;
   opacity: 0.5;
   filter: progid:DXImageTransform.Microsoft.Alpha(opacity=50);
@@ -863,6 +879,10 @@ button.primary.disabled:active,
 .catalog-product-index .actions-split > .action-toggle.primary.disabled:hover,
 .catalog-product-index .actions-split > .action-toggle.primary[disabled]:active,
 .catalog-product-index .actions-split > .action-toggle.primary.disabled:active,
+.adminhtml-integration-new .actions-split > .action-toggle.primary[disabled]:hover,
+.adminhtml-integration-new .actions-split > .action-toggle.primary.disabled:hover,
+.adminhtml-integration-new .actions-split > .action-toggle.primary[disabled]:active,
+.adminhtml-integration-new .actions-split > .action-toggle.primary.disabled:active,
 .catalog-product-new .actions-split.btn-round .action-default.primary[disabled]:hover,
 .catalog-product-new .actions-split.btn-round .action-default.primary.disabled:hover,
 .catalog-product-new .actions-split.btn-round .action-default.primary[disabled]:active,
@@ -874,7 +894,11 @@ button.primary.disabled:active,
 .catalog-product-index .actions-split.btn-round .action-default.primary[disabled]:hover,
 .catalog-product-index .actions-split.btn-round .action-default.primary.disabled:hover,
 .catalog-product-index .actions-split.btn-round .action-default.primary[disabled]:active,
-.catalog-product-index .actions-split.btn-round .action-default.primary.disabled:active {
+.catalog-product-index .actions-split.btn-round .action-default.primary.disabled:active,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary[disabled]:hover,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary.disabled:hover,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary[disabled]:active,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary.disabled:active {
   color: #676056;
   background: #f2ebde;
   border: 1px solid #ada89e;
@@ -930,9 +954,11 @@ button.primary,
 .catalog-product-new .actions-split > .action-toggle.primary,
 .catalog-product-edit .actions-split > .action-toggle.primary,
 .catalog-product-index .actions-split > .action-toggle.primary,
+.adminhtml-integration-new .actions-split > .action-toggle.primary,
 .catalog-product-new .actions-split.btn-round .action-default.primary,
 .catalog-product-edit .actions-split.btn-round .action-default.primary,
 .catalog-product-index .actions-split.btn-round .action-default.primary,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary,
 .PrimaryAddButton,
 .PrimarySplitButton > .action-toggle.primary,
 input[type=button].primary,
@@ -983,9 +1009,11 @@ button.primary,
 .catalog-product-new .actions-split > .action-toggle.primary,
 .catalog-product-edit .actions-split > .action-toggle.primary,
 .catalog-product-index .actions-split > .action-toggle.primary,
+.adminhtml-integration-new .actions-split > .action-toggle.primary,
 .catalog-product-new .actions-split.btn-round .action-default.primary,
 .catalog-product-edit .actions-split.btn-round .action-default.primary,
-.catalog-product-index .actions-split.btn-round .action-default.primary {
+.catalog-product-index .actions-split.btn-round .action-default.primary,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary {
   color: #fff;
   background: #007dbd;
   border: 1px solid #0574ad;
@@ -1092,12 +1120,16 @@ button.primary:hover,
 .catalog-product-edit .actions-split > .action-toggle.primary:hover,
 .catalog-product-index .actions-split > .action-toggle.primary:focus,
 .catalog-product-index .actions-split > .action-toggle.primary:hover,
+.adminhtml-integration-new .actions-split > .action-toggle.primary:focus,
+.adminhtml-integration-new .actions-split > .action-toggle.primary:hover,
 .catalog-product-new .actions-split.btn-round .action-default.primary:focus,
 .catalog-product-new .actions-split.btn-round .action-default.primary:hover,
 .catalog-product-edit .actions-split.btn-round .action-default.primary:focus,
 .catalog-product-edit .actions-split.btn-round .action-default.primary:hover,
 .catalog-product-index .actions-split.btn-round .action-default.primary:focus,
-.catalog-product-index .actions-split.btn-round .action-default.primary:hover {
+.catalog-product-index .actions-split.btn-round .action-default.primary:hover,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary:focus,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary:hover {
   color: #fff;
   background: #026294;
   border: 1px solid #026294;
@@ -1153,9 +1185,11 @@ button.primary:active,
 .catalog-product-new .actions-split > .action-toggle.primary:active,
 .catalog-product-edit .actions-split > .action-toggle.primary:active,
 .catalog-product-index .actions-split > .action-toggle.primary:active,
+.adminhtml-integration-new .actions-split > .action-toggle.primary:active,
 .catalog-product-new .actions-split.btn-round .action-default.primary:active,
 .catalog-product-edit .actions-split.btn-round .action-default.primary:active,
-.catalog-product-index .actions-split.btn-round .action-default.primary:active {
+.catalog-product-index .actions-split.btn-round .action-default.primary:active,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary:active {
   color: #fff;
   background: #026294;
   border: 1px solid #004c74;
@@ -1211,9 +1245,11 @@ button.primary:visited,
 .catalog-product-new .actions-split > .action-toggle.primary:visited,
 .catalog-product-edit .actions-split > .action-toggle.primary:visited,
 .catalog-product-index .actions-split > .action-toggle.primary:visited,
+.adminhtml-integration-new .actions-split > .action-toggle.primary:visited,
 .catalog-product-new .actions-split.btn-round .action-default.primary:visited,
 .catalog-product-edit .actions-split.btn-round .action-default.primary:visited,
-.catalog-product-index .actions-split.btn-round .action-default.primary:visited {
+.catalog-product-index .actions-split.btn-round .action-default.primary:visited,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary:visited {
   color: #fff;
 }
 .PrimaryButton[disabled]:hover,
@@ -1420,6 +1456,10 @@ button.primary.disabled:active,
 .catalog-product-index .actions-split > .action-toggle.primary.disabled:hover,
 .catalog-product-index .actions-split > .action-toggle.primary[disabled]:active,
 .catalog-product-index .actions-split > .action-toggle.primary.disabled:active,
+.adminhtml-integration-new .actions-split > .action-toggle.primary[disabled]:hover,
+.adminhtml-integration-new .actions-split > .action-toggle.primary.disabled:hover,
+.adminhtml-integration-new .actions-split > .action-toggle.primary[disabled]:active,
+.adminhtml-integration-new .actions-split > .action-toggle.primary.disabled:active,
 .catalog-product-new .actions-split.btn-round .action-default.primary[disabled]:hover,
 .catalog-product-new .actions-split.btn-round .action-default.primary.disabled:hover,
 .catalog-product-new .actions-split.btn-round .action-default.primary[disabled]:active,
@@ -1431,7 +1471,11 @@ button.primary.disabled:active,
 .catalog-product-index .actions-split.btn-round .action-default.primary[disabled]:hover,
 .catalog-product-index .actions-split.btn-round .action-default.primary.disabled:hover,
 .catalog-product-index .actions-split.btn-round .action-default.primary[disabled]:active,
-.catalog-product-index .actions-split.btn-round .action-default.primary.disabled:active {
+.catalog-product-index .actions-split.btn-round .action-default.primary.disabled:active,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary[disabled]:hover,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary.disabled:hover,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary[disabled]:active,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary.disabled:active {
   color: #fff;
   background: #007dbd;
   border: 1px solid #0574ad;
@@ -1479,6 +1523,7 @@ button.primary.disabled:active,
 .catalog-product-new .actions-split.btn-round .action-default.primary,
 .catalog-product-edit .actions-split.btn-round .action-default.primary,
 .catalog-product-index .actions-split.btn-round .action-default.primary,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary,
 .PrimarySplitButton.btn-round .action-default.primary,
 .sales-order-index .page-actions .add,
 .adminhtml-rma-index .page-actions .add,
@@ -1520,7 +1565,8 @@ button.primary.disabled:active,
 .catalog-product-set-index .page-actions .add,
 .catalog-product-new .actions-split.btn-round .action-default.primary,
 .catalog-product-edit .actions-split.btn-round .action-default.primary,
-.catalog-product-index .actions-split.btn-round .action-default.primary {
+.catalog-product-index .actions-split.btn-round .action-default.primary,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary {
   width: 36px;
   height: 31px;
   overflow: hidden;
@@ -1570,7 +1616,8 @@ button.primary.disabled:active,
 .catalog-product-set-index .page-actions .add:focus,
 .catalog-product-new .actions-split.btn-round .action-default.primary:focus,
 .catalog-product-edit .actions-split.btn-round .action-default.primary:focus,
-.catalog-product-index .actions-split.btn-round .action-default.primary:focus {
+.catalog-product-index .actions-split.btn-round .action-default.primary:focus,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary:focus {
   outline: none;
 }
 .PrimaryAddButton > span,
@@ -1615,7 +1662,8 @@ button.primary.disabled:active,
 .catalog-product-set-index .page-actions .add > span,
 .catalog-product-new .actions-split.btn-round .action-default.primary > span,
 .catalog-product-edit .actions-split.btn-round .action-default.primary > span,
-.catalog-product-index .actions-split.btn-round .action-default.primary > span {
+.catalog-product-index .actions-split.btn-round .action-default.primary > span,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary > span {
   text-indent: -999em;
   display: block;
   width: 34px;
@@ -1663,7 +1711,8 @@ button.primary.disabled:active,
 .catalog-product-set-index .page-actions .add > span:before,
 .catalog-product-new .actions-split.btn-round .action-default.primary > span:before,
 .catalog-product-edit .actions-split.btn-round .action-default.primary > span:before,
-.catalog-product-index .actions-split.btn-round .action-default.primary > span:before {
+.catalog-product-index .actions-split.btn-round .action-default.primary > span:before,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary > span:before {
   text-indent: 0;
   font-family: 'MUI-Icons';
   font-weight: normal;
@@ -1722,43 +1771,51 @@ button.primary.disabled:active,
 .eq-ie9 .catalog-product-set-index .page-actions .add > span:before,
 .eq-ie9 .catalog-product-new .actions-split.btn-round .action-default.primary > span:before,
 .eq-ie9 .catalog-product-edit .actions-split.btn-round .action-default.primary > span:before,
-.eq-ie9 .catalog-product-index .actions-split.btn-round .action-default.primary > span:before {
+.eq-ie9 .catalog-product-index .actions-split.btn-round .action-default.primary > span:before,
+.eq-ie9 .adminhtml-integration-new .actions-split.btn-round .action-default.primary > span:before {
   line-height: 31px;
 }
 .PrimarySplitButton.btn-round .action-default.primary,
 .catalog-product-new .actions-split.btn-round .action-default.primary,
 .catalog-product-edit .actions-split.btn-round .action-default.primary,
 .catalog-product-index .actions-split.btn-round .action-default.primary,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary,
 .catalog-product-new .actions-split.btn-round .action-default.primary,
 .catalog-product-edit .actions-split.btn-round .action-default.primary,
-.catalog-product-index .actions-split.btn-round .action-default.primary {
+.catalog-product-index .actions-split.btn-round .action-default.primary,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary {
   border-radius: 2px 0 0 2px;
 }
 .PrimarySplitButton.btn-round .action-default.primary:focus,
 .catalog-product-new .actions-split.btn-round .action-default.primary:focus,
 .catalog-product-edit .actions-split.btn-round .action-default.primary:focus,
-.catalog-product-index .actions-split.btn-round .action-default.primary:focus {
+.catalog-product-index .actions-split.btn-round .action-default.primary:focus,
+.adminhtml-integration-new .actions-split.btn-round .action-default.primary:focus {
   outline: none;
 }
 .PrimarySplitButton > .action-default.primary,
 .catalog-product-new .actions-split > .action-default.primary,
 .catalog-product-edit .actions-split > .action-default.primary,
-.catalog-product-index .actions-split > .action-default.primary {
+.catalog-product-index .actions-split > .action-default.primary,
+.adminhtml-integration-new .actions-split > .action-default.primary {
   border-radius: 2px 0 0 2px;
 }
 .PrimarySplitButton > .action-default.primary:focus,
 .catalog-product-new .actions-split > .action-default.primary:focus,
 .catalog-product-edit .actions-split > .action-default.primary:focus,
-.catalog-product-index .actions-split > .action-default.primary:focus {
+.catalog-product-index .actions-split > .action-default.primary:focus,
+.adminhtml-integration-new .actions-split > .action-default.primary:focus {
   outline: none;
 }
 .PrimarySplitButton > .action-toggle.primary,
 .catalog-product-new .actions-split > .action-toggle.primary,
 .catalog-product-edit .actions-split > .action-toggle.primary,
 .catalog-product-index .actions-split > .action-toggle.primary,
+.adminhtml-integration-new .actions-split > .action-toggle.primary,
 .catalog-product-new .actions-split > .action-toggle.primary,
 .catalog-product-edit .actions-split > .action-toggle.primary,
-.catalog-product-index .actions-split > .action-toggle.primary {
+.catalog-product-index .actions-split > .action-toggle.primary,
+.adminhtml-integration-new .actions-split > .action-toggle.primary {
   overflow: hidden;
   z-index: 1;
   padding: 0;
@@ -1775,19 +1832,22 @@ button.primary.disabled:active,
 .PrimarySplitButton > .action-toggle.primary:focus,
 .catalog-product-new .actions-split > .action-toggle.primary:focus,
 .catalog-product-edit .actions-split > .action-toggle.primary:focus,
-.catalog-product-index .actions-split > .action-toggle.primary:focus {
+.catalog-product-index .actions-split > .action-toggle.primary:focus,
+.adminhtml-integration-new .actions-split > .action-toggle.primary:focus {
   outline: none;
 }
 .PrimarySplitButton > .action-toggle.primary:before,
 .catalog-product-new .actions-split > .action-toggle.primary:before,
 .catalog-product-edit .actions-split > .action-toggle.primary:before,
-.catalog-product-index .actions-split > .action-toggle.primary:before {
+.catalog-product-index .actions-split > .action-toggle.primary:before,
+.adminhtml-integration-new .actions-split > .action-toggle.primary:before {
   text-align: center;
 }
 .PrimarySplitButton .dropdown-menu,
 .catalog-product-new .actions-split .dropdown-menu,
 .catalog-product-edit .actions-split .dropdown-menu,
-.catalog-product-index .actions-split .dropdown-menu {
+.catalog-product-index .actions-split .dropdown-menu,
+.adminhtml-integration-new .actions-split .dropdown-menu {
   left: 0;
   right: auto;
   z-index: 1;
@@ -1795,7 +1855,8 @@ button.primary.disabled:active,
 .PrimarySplitButton .dropdown-menu > li > .item,
 .catalog-product-new .actions-split .dropdown-menu > li > .item,
 .catalog-product-edit .actions-split .dropdown-menu > li > .item,
-.catalog-product-index .actions-split .dropdown-menu > li > .item {
+.catalog-product-index .actions-split .dropdown-menu > li > .item,
+.adminhtml-integration-new .actions-split .dropdown-menu > li > .item {
   padding: 9px 10px 10px;
 }
 .PrimarySplitButton.active > .action-toggle.primary,
@@ -1805,7 +1866,9 @@ button.primary.disabled:active,
 .catalog-product-edit .actions-split.active > .action-toggle.primary,
 .catalog-product-edit .actions-split.active > .action-toggle.primary:hover,
 .catalog-product-index .actions-split.active > .action-toggle.primary,
-.catalog-product-index .actions-split.active > .action-toggle.primary:hover {
+.catalog-product-index .actions-split.active > .action-toggle.primary:hover,
+.adminhtml-integration-new .actions-split.active > .action-toggle.primary,
+.adminhtml-integration-new .actions-split.active > .action-toggle.primary:hover {
   background: #026294;
   border: 1px solid #004c74;
 }
@@ -5858,6 +5921,7 @@ tr.dynamic-grid input.input-text {
 #up_sell_product_grid table.data th > span,
 #related_product_grid table.data th > span,
 #productGrid_table th > span,
+#customerGrid_table th > span,
 #setGrid_table th > span,
 #attributeGrid_table th > span,
 .custom-options .data-table th > span,
@@ -6933,6 +6997,12 @@ table .col-draggable .draggable-handle {
   display: inline-block;
   float: none;
 }
+.fpt-item-container select {
+  width: 100%;
+}
+.fpt-item-container select:first-child {
+  margin-bottom: 8px;
+}
 .clearfix:before,
 .clearfix:after,
 [class$="-layout"]:after,
@@ -8675,9 +8745,6 @@ table .col-draggable .draggable-handle {
 /*
     Dashboard
 -------------------------------------- */
-.dashboard-inner {
-  border: 1px solid #ccc;
-}
 .adminhtml-dashboard-index .col-2-left-layout,
 .adminhtml-dashboard-index .col-1-layout {
   min-width: 0;
@@ -8686,9 +8753,33 @@ table .col-draggable .draggable-handle {
   width: 38%;
   padding: 1%;
 }
+.adminhtml-dashboard-index .side-col .entry-edit {
+  padding: 10px 15px 10px 10px;
+  margin-bottom: 5px;
+}
+.adminhtml-dashboard-index .side-col .entry-edit .entry-edit-head {
+  margin-bottom: 20px;
+}
+.adminhtml-dashboard-index .side-col .entry-edit .entry-edit-head h4 {
+  margin: 0;
+}
+.adminhtml-dashboard-index .side-col .entry-edit fieldset {
+  padding: 0;
+  border: 0;
+}
+.adminhtml-dashboard-index .side-col .entry-edit fieldset .grid {
+  padding-bottom: 0;
+}
 .adminhtml-dashboard-index .col-2-left-layout .main-col {
   min-width: 0;
   width: 60%;
+  padding: 16px 30px 30px;
+}
+.adminhtml-dashboard-index .col-2-left-layout .main-col .store-switcher-alt {
+  margin-bottom: 15px;
+}
+.adminhtml-dashboard-index .col-2-left-layout .main-col .store-switcher-alt > strong {
+  padding-left: 0;
 }
 .dashboard-container {
   border-radius: 0;
@@ -8696,9 +8787,6 @@ table .col-draggable .draggable-handle {
 .dashboard-container.col-2-left-layout:before {
   left: 40%;
 }
-.dashboard-container .dashboard-inner {
-  padding: 20px;
-}
 .dashboard-inner .tabs-horiz > li a {
   padding-left: 14px;
   padding-right: 14px;
@@ -8964,26 +9052,31 @@ table .col-draggable .draggable-handle {
 }
 .sales-order-create-index thead .col-entity_id,
 .sales-order-create-index .col-entity_id,
-.sales-order-create-index .col-qty {
+.sales-order-create-index .col-qty,
+.checkout-index-index .col-qty {
   width: 50px;
 }
-.sales-order-create-index .col-in_products {
+.sales-order-create-index .col-in_products,
+.checkout-index-index .col-in_products {
   text-align: center;
 }
 .sales-order-create-index .col-sku,
-.sales-order-create-index .col-remove {
+.sales-order-create-index .col-remove,
+.checkout-index-index .col-remove {
   width: 120px;
 }
 .sales-order-create-index .col-price {
   width: 70px;
 }
-.sales-order-create-index .order-search-items .col-name {
+.sales-order-create-index .order-search-items .col-name,
+.checkout-index-index #source_products_table .col-name {
   width: 50%;
 }
 .sales-order-create-index .order-items.fieldset-wrapper .fieldset-wrapper-title,
 .sales-order-create-index .order-search-items.fieldset-wrapper .fieldset-wrapper-title,
 .sales-order-create-index .order-additional-area.fieldset-wrapper .fieldset-wrapper-title,
-.sales-order-create-index .order-errors .fieldset-wrapper-title {
+.sales-order-create-index .order-errors .fieldset-wrapper-title,
+.checkout-index-index .checkout-errors .fieldset-wrapper-title {
   border-bottom: 0;
   margin: 0;
 }
@@ -8994,7 +9087,8 @@ table .col-draggable .draggable-handle {
 .sales-order-create-index .order-items.fieldset-wrapper .title,
 .sales-order-create-index .order-additional-area.fieldset-wrapper .title,
 .sales-order-create-index .order-search-items.fieldset-wrapper .title,
-.sales-order-create-index .order-errors .title {
+.sales-order-create-index .order-errors .title,
+.checkout-index-index .checkout-errors .title {
   border-bottom: 1px solid #ededed;
   float: none;
   margin: 0 0 18px;
@@ -9002,7 +9096,8 @@ table .col-draggable .draggable-handle {
 }
 .sales-order-create-index .order-items.fieldset-wrapper .actions,
 .sales-order-create-index .order-search-items.fieldset-wrapper .actions,
-.sales-order-create-index #order-errors .actions {
+.sales-order-create-index #order-errors .actions,
+.checkout-index-index .checkout-errors .fieldset-wrapper-title .actions {
   float: none;
   border: 1px solid #c0bbaf;
   border-bottom: 0;
@@ -9019,7 +9114,8 @@ table .col-draggable .draggable-handle {
   padding: 0 8px;
   position: relative;
 }
-.sales-order-create-index #order-data .fieldset-wrapper .actions .action-add {
+.sales-order-create-index #order-data .fieldset-wrapper .actions .action-add,
+.checkout-index-index .checkout-errors .fieldset-wrapper-title .actions .action-add {
   margin: 7px 8px 8px 0;
 }
 .sales-order-create-index .order-additional-area.fieldset-wrapper .actions {
@@ -9027,8 +9123,9 @@ table .col-draggable .draggable-handle {
   margin: 0 0 8px;
   padding: 0;
 }
-.sales-order-create-index #order-data .fieldset-wrapper .actions .action-delete {
-  margin: 11px 0 0;
+.sales-order-create-index #order-data .fieldset-wrapper .actions .action-delete,
+.checkout-index-index .checkout-errors .fieldset-wrapper-title .actions .action-delete {
+  margin: 13px 0 0;
 }
 .sales-order-create-index .ui-dialog .downloadable.information .link .label {
   margin-left: 0;
@@ -9051,6 +9148,47 @@ table .col-draggable .draggable-handle {
   margin: 0 0 0 10px;
   width: 60px;
 }
+.tax.summary-total .summary-collapse {
+  cursor: pointer;
+  display: inline-block;
+}
+.tax.summary-total .summary-collapse:before {
+  content: "\e02d";
+  color: #816063;
+  background: #f2ebde;
+  display: inline-block;
+  text-indent: 0;
+  font-size: 16px;
+  width: 16px;
+  height: 16px;
+  line-height: 16px;
+  overflow: hidden;
+  font-family: 'MUI-Icons';
+  border: 1px solid #ada89e;
+  font-style: normal;
+  vertical-align: top;
+  margin-right: 7px;
+  font-weight: normal;
+  speak: none;
+  -webkit-font-smoothing: antialiased;
+  border-radius: 2px;
+}
+.tax.summary-total .summary-collapse:hover:before {
+  background: #cac3b4;
+}
+.tax.summary-total.show-details .summary-collapse:before {
+  content: "\e03a";
+}
+tr.row-totals:nth-child(even) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(even) td,
+tr.row-totals:nth-child(even) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(even) ~ tr.row-totals:nth-child(even) td,
+tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(odd) ~ tr.row-totals:nth-child(even) td {
+  background: #fbfaf6;
+}
+tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(odd) ~ tr.row-totals:nth-child(odd) td,
+tr.row-totals:nth-child(even) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(even) ~ tr.row-totals:nth-child(odd) td,
+tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(odd) td {
+  background: #fff;
+}
 /* ----------------------------------- */
 #order-data .page-actions {
   padding-top: 0;
@@ -9936,9 +10074,56 @@ table.items-to-invoice tbody tr:hover td {
 .adminhtml-system-currencysymbol-index td.col-currency .label {
   margin-top: 5px;
 }
+/*
+    Categories
+-------------------------------------- */
+.category-content .form-inline.permissions-custom-options .messages li {
+  margin-top: 0;
+}
+.category-content .form-inline.permissions-custom-options .data-table {
+  margin-bottom: 25px;
+}
+/*
+    Marketing - Email Reminders
+-------------------------------------- */
+.lt-1280 .adminhtml-reminder-edit #customerGrid .grid .filter .range div.date {
+  min-width: 0;
+}
+/*
+    Customers - Manage Shopping Cart
+-------------------------------------- */
+.checkout-index-index .products-search {
+  margin-top: 35px;
+}
+.checkout-index-index .products-search > .actions {
+  text-align: right;
+  margin: 10px 0;
+}
+.checkout-index-index .shopping-cart-items > .actions {
+  margin-bottom: 15px;
+}
+.checkout-index-index .shopping-cart-items .box-left,
+.checkout-index-index .shopping-cart-items .box.right {
+  width: 49%;
+}
+.checkout-index-index .shopping-cart-items .box-left fieldset,
+.checkout-index-index .shopping-cart-items .box.right fieldset {
+  border-radius: 5px;
+}
+.checkout-index-index .shopping-cart-items .box-left {
+  float: left;
+}
+.checkout-index-index .shopping-cart-items .box.right {
+  float: right;
+}
+.checkout-index-index .grid table .action-configure {
+  float: right;
+}
 /*
     Clearfix
 -------------------------------------- */
+.shopping-cart-items:before,
+.shopping-cart-items:after,
 .image-panel:before,
 .image-panel:after,
 .images:before,
@@ -9950,6 +10135,7 @@ table.items-to-invoice tbody tr:hover td {
   content: "";
   display: table;
 }
+.shopping-cart-items:after,
 .image-panel:after,
 .images:after,
 .tax-rate-popup .field:after,
diff --git a/app/design/adminhtml/magento_backend/less/styles/admin.less b/app/design/adminhtml/magento_backend/less/styles/admin.less
index a3ae1bf4600245410a958d5b7e6ab6f317017e30..654177fa9ef4f897683a1a18c08c952dc00a0468 100644
--- a/app/design/adminhtml/magento_backend/less/styles/admin.less
+++ b/app/design/adminhtml/magento_backend/less/styles/admin.less
@@ -4602,6 +4602,7 @@ tr.dynamic-grid input.input-text {
 #up_sell_product_grid table.data th > span,
 #related_product_grid table.data th > span,
 #productGrid_table th > span,
+#customerGrid_table th > span,
 #setGrid_table th > span,
 #attributeGrid_table th > span,
 .custom-options .data-table th > span,
@@ -5771,6 +5772,14 @@ button,
     float: none;
 }
 
+.fpt-item-container select {
+    width: 100%;
+
+    &:first-child {
+        margin-bottom: 8px;
+    }
+}
+
 // Clearfix
 .clearfix:before,
 .clearfix:after,
diff --git a/app/design/adminhtml/magento_backend/less/styles/pages.less b/app/design/adminhtml/magento_backend/less/styles/pages.less
index b3df16f4cff564f855e3884d711191a35edff0c3..17e5ef24e4501d4ffd09207acbce6ea7d3b225b1 100644
--- a/app/design/adminhtml/magento_backend/less/styles/pages.less
+++ b/app/design/adminhtml/magento_backend/less/styles/pages.less
@@ -1146,10 +1146,6 @@
 /*
     Dashboard
 -------------------------------------- */
-.dashboard-inner {
-    border: 1px solid #ccc;
-}
-
 .adminhtml-dashboard-index .col-2-left-layout,
 .adminhtml-dashboard-index .col-1-layout {
     min-width: 0;
@@ -1158,11 +1154,35 @@
 .adminhtml-dashboard-index .side-col {
     width: 38%;
     padding: 1%;
+    .entry-edit {
+        padding: 10px 15px 10px 10px;
+        margin-bottom: 5px;
+        .entry-edit-head {
+            h4 {
+                margin: 0;
+            }
+            margin-bottom: 20px;
+        }
+        fieldset {
+            padding: 0;
+            border: 0;
+            .grid {
+                padding-bottom: 0;
+            }
+        }
+    }
 }
 
 .adminhtml-dashboard-index .col-2-left-layout .main-col {
     min-width: 0;
     width: 60%;
+    padding: 16px 30px 30px;
+    .store-switcher-alt {
+        margin-bottom: 15px;
+        > strong {
+            padding-left: 0;
+        }
+    }
 }
 
 .dashboard-container {
@@ -1173,10 +1193,6 @@
     left: 40%;
 }
 
-.dashboard-container .dashboard-inner {
-    padding: 20px;
-}
-
 .dashboard-inner .tabs-horiz > li a {
     padding-left: 14px;
     padding-right: 14px;
@@ -1485,16 +1501,19 @@
 
 .sales-order-create-index thead .col-entity_id,
 .sales-order-create-index .col-entity_id,
-.sales-order-create-index .col-qty {
+.sales-order-create-index .col-qty,
+.checkout-index-index .col-qty {
     width: 50px;
 }
 
-.sales-order-create-index .col-in_products {
+.sales-order-create-index .col-in_products,
+.checkout-index-index .col-in_products {
     text-align: center;
 }
 
 .sales-order-create-index .col-sku,
-.sales-order-create-index .col-remove {
+.sales-order-create-index .col-remove,
+.checkout-index-index .col-remove {
     width: 120px;
 }
 
@@ -1502,14 +1521,16 @@
     width: 70px;
 }
 
-.sales-order-create-index .order-search-items .col-name {
+.sales-order-create-index .order-search-items .col-name,
+.checkout-index-index #source_products_table .col-name {
     width: 50%;
 }
 
 .sales-order-create-index .order-items.fieldset-wrapper .fieldset-wrapper-title,
 .sales-order-create-index .order-search-items.fieldset-wrapper .fieldset-wrapper-title,
 .sales-order-create-index .order-additional-area.fieldset-wrapper .fieldset-wrapper-title,
-.sales-order-create-index .order-errors .fieldset-wrapper-title {
+.sales-order-create-index .order-errors .fieldset-wrapper-title,
+.checkout-index-index .checkout-errors .fieldset-wrapper-title {
     border-bottom: 0;
     margin: 0;
 }
@@ -1522,7 +1543,8 @@
 .sales-order-create-index .order-items.fieldset-wrapper .title,
 .sales-order-create-index .order-additional-area.fieldset-wrapper .title,
 .sales-order-create-index .order-search-items.fieldset-wrapper .title,
-.sales-order-create-index .order-errors .title {
+.sales-order-create-index .order-errors .title,
+.checkout-index-index .checkout-errors .title {
     border-bottom: 1px solid #ededed;
     float: none;
     margin: 0 0 18px;
@@ -1531,7 +1553,8 @@
 
 .sales-order-create-index .order-items.fieldset-wrapper .actions,
 .sales-order-create-index .order-search-items.fieldset-wrapper .actions,
-.sales-order-create-index #order-errors .actions {
+.sales-order-create-index #order-errors .actions,
+.checkout-index-index .checkout-errors .fieldset-wrapper-title .actions {
     float: none;
     border: 1px solid #c0bbaf;
     border-bottom: 0;
@@ -1549,7 +1572,8 @@
     position: relative;
 }
 
-.sales-order-create-index #order-data .fieldset-wrapper .actions .action-add {
+.sales-order-create-index #order-data .fieldset-wrapper .actions .action-add,
+.checkout-index-index .checkout-errors .fieldset-wrapper-title .actions .action-add {
     margin: 7px 8px 8px 0;
 }
 
@@ -1559,8 +1583,9 @@
     padding: 0;
 }
 
-.sales-order-create-index #order-data .fieldset-wrapper .actions .action-delete {
-    margin: 11px 0 0;
+.sales-order-create-index #order-data .fieldset-wrapper .actions .action-delete,
+.checkout-index-index .checkout-errors .fieldset-wrapper-title .actions .action-delete {
+    margin: 13px 0 0;
 }
 
 .sales-order-create-index {
@@ -1596,6 +1621,51 @@
     }
 }
 
+.tax.summary-total .summary-collapse {
+    cursor: pointer;
+    display: inline-block;
+    &:before {
+        @iconsize: 16px;
+        content: "\e02d";
+        color: #816063;
+        background: #f2ebde;
+        display: inline-block;
+        text-indent: 0;
+        font-size: @iconsize;
+        width:@iconsize;
+        height:@iconsize;
+        line-height: @iconsize;
+        overflow: hidden;
+        font-family: 'MUI-Icons';
+        border:1px solid #ada89e;
+        font-style: normal;
+        vertical-align: top;
+        margin-right:7px;
+        font-weight: normal;
+        speak: none;
+        -webkit-font-smoothing: antialiased;
+        border-radius: 2px;
+    }
+    &:hover:before {
+        background: #cac3b4;
+    }
+}
+.tax.summary-total.show-details .summary-collapse:before {
+    content: "\e03a";
+}
+
+tr.row-totals:nth-child(even) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(even) td,
+tr.row-totals:nth-child(even) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(even) ~ tr.row-totals:nth-child(even) td,
+tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(odd) ~ tr.row-totals:nth-child(even) td {
+    background:  #fbfaf6;
+}
+
+tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(odd) ~ tr.row-totals:nth-child(odd) td,
+tr.row-totals:nth-child(even) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(even) ~ tr.row-totals:nth-child(odd) td,
+tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-details):nth-child(odd) td {
+    background: #fff;
+}
+
 /* ----------------------------------- */
 
 #order-data .page-actions {
@@ -2660,9 +2730,66 @@ table.items-to-invoice tbody tr:hover td {
     margin-top: 5px;
 }
 
+/*
+    Categories
+-------------------------------------- */
+.category-content .form-inline.permissions-custom-options {
+    .messages {
+        li {
+            margin-top: 0;
+        }
+    }
+    .data-table {
+        margin-bottom: 25px;
+    }
+}
+
+/*
+    Marketing - Email Reminders
+-------------------------------------- */
+.lt-1280 .adminhtml-reminder-edit #customerGrid .grid .filter .range div.date {
+    min-width: 0;
+}
+
+/*
+    Customers - Manage Shopping Cart
+-------------------------------------- */
+.checkout-index-index {
+    .products-search {
+        margin-top: 35px;
+        > .actions {
+            text-align: right;
+            margin: 10px 0;
+        }
+    }
+    .shopping-cart-items {
+        > .actions {
+            margin-bottom: 15px;
+        }
+        .box-left,
+        .box.right {
+            width: 49%;
+            fieldset {
+                border-radius: 5px;
+            }
+        }
+        .box-left {
+            float: left;
+        }
+        .box.right {
+            float: right;
+        }
+    }
+    .grid table .action-configure {
+        float: right;
+    }
+}
+
 /*
     Clearfix
 -------------------------------------- */
+.shopping-cart-items:before,
+.shopping-cart-items:after,
 .image-panel:before,
 .image-panel:after,
 .images:before,
@@ -2675,6 +2802,7 @@ table.items-to-invoice tbody tr:hover td {
     display: table;
 }
 
+.shopping-cart-items:after,
 .image-panel:after,
 .images:after,
 .tax-rate-popup .field:after,
diff --git a/app/design/adminhtml/magento_backend/mui/elements.css b/app/design/adminhtml/magento_backend/mui/elements.css
index 225b684757b6667812c346e568f2ef62424a0ca3..6e7f1fa381371064813a5a1f87b4a6426b73f745 100644
--- a/app/design/adminhtml/magento_backend/mui/elements.css
+++ b/app/design/adminhtml/magento_backend/mui/elements.css
@@ -92,7 +92,7 @@
     padding: 4px 8px;
     border-radius: 3px;
     background: #000;
-    background: rgba(0, 0, 0, .8);
+    background: rgba(49, 48, 43, .8);
     color: #fff;
     text-shadow: none;
     z-index: 20;
diff --git a/app/design/adminhtml/magento_backend/mui/form.css b/app/design/adminhtml/magento_backend/mui/form.css
index 1bd9394ab5bc1b0cb238a24a9f96b370cdd8b960..589511327efda46da4d1cec7c07e3c1cae75dbba 100644
--- a/app/design/adminhtml/magento_backend/mui/form.css
+++ b/app/design/adminhtml/magento_backend/mui/form.css
@@ -518,4 +518,4 @@ span.required {
 .form-actions:after,
 .clearfix:after {
     clear: both;
-}
\ No newline at end of file
+}
diff --git a/app/design/frontend/magento_plushe/Magento_Customer/layout/default.xml b/app/design/frontend/magento_plushe/Magento_Customer/layout/default.xml
index f4023d945d8af6511b2eaa0fa993ca183e2f61e5..563acc6a891c713314fa7092f0044b28e2a47142 100644
--- a/app/design/frontend/magento_plushe/Magento_Customer/layout/default.xml
+++ b/app/design/frontend/magento_plushe/Magento_Customer/layout/default.xml
@@ -25,13 +25,13 @@
 -->
 <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <referenceBlock name="header.links">
-        <block class="Magento\Customer\Block\Account\Customer" name="customer" template="account/customer.phtml" />
+        <block class="Magento\Customer\Block\Account\Customer" name="customer" template="account/customer.phtml" before="-" />
+        <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link-login"/>
         <block class="Magento\Customer\Block\Account\RegisterLink" after="authorization-link-login" name="register-link">
             <arguments>
                 <argument name="label" xsi:type="string">Register</argument>
             </arguments>
         </block>
-        <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link-login"/>
     </referenceBlock>
     <move element="register-link" destination="header.links"/>
     <move element="top.links" destination="customer"/>
diff --git a/app/design/frontend/magento_plushe/css/styles.css b/app/design/frontend/magento_plushe/css/styles.css
index 019d1f28a4a9d6a3de5fd408ac54d3b56673437e..da78f58a7e6b99ec2e385fbb5af6271acdaf7248 100644
--- a/app/design/frontend/magento_plushe/css/styles.css
+++ b/app/design/frontend/magento_plushe/css/styles.css
@@ -420,6 +420,25 @@ hr {
   background: #f8f8f8;
   padding: 30px;
 }
+.visuallyHidden {
+  border: 0;
+  clip: rect(0 0 0 0);
+  height: 1px;
+  margin: -1px;
+  overflow: hidden;
+  padding: 0;
+  position: absolute;
+  width: 1px;
+}
+.visuallyHidden.focusable:active,
+.visuallyHidden.focusable:focus {
+  clip: auto;
+  height: auto;
+  margin: 0;
+  overflow: visible;
+  position: static;
+  width: auto;
+}
 .primary.action,
 .action.myPrimary,
 input[type="submit"],
@@ -483,8 +502,8 @@ input[type="button"],
 .form.search.advanced .actions .action,
 .form.orders.search .actions .action,
 .form.contact .actions .action,
-.data.table.wishlist + .actions .primary .action.share,
-.data.table.wishlist + .actions .primary .action.update,
+.wrapper.table + .actions .primary .action.share,
+.wrapper.table + .actions .primary .action.update,
 .recurring.order.details > .actions .primary .action,
 .form.send.confirmation .action.send,
 .action.myPrimary,
@@ -549,8 +568,8 @@ input[type="button"],
 .form.search.advanced .actions .action,
 .form.orders.search .actions .action,
 .form.contact .actions .action,
-.data.table.wishlist + .actions .primary .action.share,
-.data.table.wishlist + .actions .primary .action.update,
+.wrapper.table + .actions .primary .action.share,
+.wrapper.table + .actions .primary .action.update,
 .recurring.order.details > .actions .primary .action,
 .form.send.confirmation .action.send {
   background-color: #da370a;
@@ -745,12 +764,12 @@ input[type="button"]:hover,
 .form.contact .actions .action:focus,
 .form.contact .actions .action:active,
 .form.contact .actions .action:hover,
-.data.table.wishlist + .actions .primary .action.share:focus,
-.data.table.wishlist + .actions .primary .action.share:active,
-.data.table.wishlist + .actions .primary .action.share:hover,
-.data.table.wishlist + .actions .primary .action.update:focus,
-.data.table.wishlist + .actions .primary .action.update:active,
-.data.table.wishlist + .actions .primary .action.update:hover,
+.wrapper.table + .actions .primary .action.share:focus,
+.wrapper.table + .actions .primary .action.share:active,
+.wrapper.table + .actions .primary .action.share:hover,
+.wrapper.table + .actions .primary .action.update:focus,
+.wrapper.table + .actions .primary .action.update:active,
+.wrapper.table + .actions .primary .action.update:hover,
 .recurring.order.details > .actions .primary .action:focus,
 .recurring.order.details > .actions .primary .action:active,
 .recurring.order.details > .actions .primary .action:hover,
@@ -771,7 +790,7 @@ input[type="reset"],
 .data.comparison .cell.remove .action.delete,
 .sidebar .minilist.products.items .action.tocart,
 .find.orders .action.submit,
-.form.send.friend .actions > .primary .action.add,
+.form.send.friend .fieldset.recipients .actions .action.add,
 .paypal.review.view .actions .action.update,
 .shipping-tracking-popup .action.close,
 .action.mySecondary,
@@ -785,7 +804,7 @@ input[type="reset"],
 .data.comparison .cell.remove .action.delete,
 .sidebar .minilist.products.items .action.tocart,
 .find.orders .action.submit,
-.form.send.friend .actions > .primary .action.add,
+.form.send.friend .fieldset.recipients .actions .action.add,
 .paypal.review.view .actions .action.update,
 .shipping-tracking-popup .action.close {
   background-color: #c2c2c2;
@@ -827,9 +846,9 @@ input[type="reset"]:hover,
 .find.orders .action.submit:focus,
 .find.orders .action.submit:active,
 .find.orders .action.submit:hover,
-.form.send.friend .actions > .primary .action.add:focus,
-.form.send.friend .actions > .primary .action.add:active,
-.form.send.friend .actions > .primary .action.add:hover,
+.form.send.friend .fieldset.recipients .actions .action.add:focus,
+.form.send.friend .fieldset.recipients .actions .action.add:active,
+.form.send.friend .fieldset.recipients .actions .action.add:hover,
 .paypal.review.view .actions .action.update:focus,
 .paypal.review.view .actions .action.update:active,
 .paypal.review.view .actions .action.update:hover,
@@ -938,13 +957,13 @@ input[type="reset"],
 .form.password.reset .action.add,
 .form.paypal.review .action.add,
 .form.send.confirmation .action.add,
-.form.send.friend .actions > .primary .action.add,
+.form.send.friend .fieldset.recipients .actions .action.add,
 .form.search.advanced .actions .action,
 .form.orders.search .actions .action,
 .form.contact .actions .action,
 .paypal.review.view .actions .action.update,
-.data.table.wishlist + .actions .primary .action.share,
-.data.table.wishlist + .actions .primary .action.update,
+.wrapper.table + .actions .primary .action.share,
+.wrapper.table + .actions .primary .action.update,
 .shipping-tracking-popup .action.close,
 .recurring.order.details > .actions .primary .action,
 .form.send.confirmation .action.send {
@@ -1195,7 +1214,8 @@ input[type="tel"],
 input[type="url"],
 input[type="email"],
 input[type="datetime"],
-input[type="password"] {
+input[type="password"],
+input[type="number"] {
   -moz-box-sizing: border-box;
   -webkit-box-sizing: border-box;
   -ms-box-sizing: border-box;
@@ -1218,7 +1238,8 @@ input[type="tel"]:focus,
 input[type="url"]:focus,
 input[type="email"]:focus,
 input[type="datetime"]:focus,
-input[type="password"]:focus {
+input[type="password"]:focus,
+input[type="number"]:focus {
   border-color: #999999;
 }
 .control input[type="text"],
@@ -1227,7 +1248,8 @@ input[type="password"]:focus {
 .control input[type="url"],
 .control input[type="email"],
 .control input[type="datetime"],
-.control input[type="password"] {
+.control input[type="password"],
+.control input[type="number"] {
   width: 100%;
 }
 input[type="text"]:disabled,
@@ -1236,7 +1258,8 @@ input[type="tel"]:disabled,
 input[type="url"]:disabled,
 input[type="email"]:disabled,
 input[type="datetime"]:disabled,
-input[type="password"]:disabled {
+input[type="password"]:disabled,
+input[type="number"]:disabled {
   opacity: 0.5;
 }
 input[type="text"]::-webkit-input-placeholder,
@@ -1245,7 +1268,8 @@ input[type="tel"]::-webkit-input-placeholder,
 input[type="url"]::-webkit-input-placeholder,
 input[type="email"]::-webkit-input-placeholder,
 input[type="datetime"]::-webkit-input-placeholder,
-input[type="password"]::-webkit-input-placeholder {
+input[type="password"]::-webkit-input-placeholder,
+input[type="number"]::-webkit-input-placeholder {
   line-height: 1.333;
 }
 input[type="text"]:-ms-input-placeholder,
@@ -1254,7 +1278,8 @@ input[type="tel"]:-ms-input-placeholder,
 input[type="url"]:-ms-input-placeholder,
 input[type="email"]:-ms-input-placeholder,
 input[type="datetime"]:-ms-input-placeholder,
-input[type="password"]:-ms-input-placeholder {
+input[type="password"]:-ms-input-placeholder,
+input[type="number"]:-ms-input-placeholder {
   line-height: 1.333;
 }
 .eq-ie8 input[type="text"],
@@ -1263,9 +1288,15 @@ input[type="password"]:-ms-input-placeholder {
 .eq-ie8 input[type="url"],
 .eq-ie8 input[type="email"],
 .eq-ie8 input[type="datetime"],
-.eq-ie8 input[type="password"] {
+.eq-ie8 input[type="password"],
+.eq-ie8 input[type="number"] {
   padding-top: 8px;
 }
+input[type=number]::-webkit-inner-spin-button,
+input[type=number]::-webkit-outer-spin-button {
+  -webkit-appearance: none;
+  margin: 0;
+}
 select {
   -moz-box-sizing: border-box;
   -webkit-box-sizing: border-box;
@@ -1329,7 +1360,8 @@ textarea:disabled {
 .fieldset input[type="url"].valid,
 .fieldset input[type="email"].valid,
 .fieldset input[type="datetime"].valid,
-.fieldset input[type="password"].valid {
+.fieldset input[type="password"].valid,
+.fieldset input[type="number"].valid {
   border-color: #42b649 !important;
 }
 .fieldset textarea.mage-error,
@@ -1340,7 +1372,8 @@ textarea:disabled {
 .fieldset input[type="url"].mage-error,
 .fieldset input[type="email"].mage-error,
 .fieldset input[type="datetime"].mage-error,
-.fieldset input[type="password"].mage-error {
+.fieldset input[type="password"].mage-error,
+.fieldset input[type="number"].mage-error {
   border-color: #da370a !important;
 }
 .fieldset div.mage-error[generated] {
@@ -4472,6 +4505,7 @@ body {
   border-radius: 0 0 5px 5px;
   overflow: hidden;
   z-index: 5;
+  display: none;
 }
 .block.search .search.autocomplete ul {
   padding: 0;
@@ -4559,10 +4593,20 @@ body {
   font-weight: 200;
   font-size: 20px;
 }
+.column.main .block > .title .qty.counter,
+.sidebar .block > .title .qty.counter {
+  font-size: 16px;
+}
 .column.main .block.filter .item,
 .sidebar .block.filter .item {
   margin-bottom: 10px;
 }
+.qty.counter:before {
+  content: "(";
+}
+.qty.counter:after {
+  content: ")";
+}
 .sidebar .block > .title strong {
   font-size: 18px;
 }
@@ -5222,10 +5266,6 @@ body {
     Magento_Checkout
     One page
 -------------------------------------- */
-.block.progress.onepage {
-  float: left;
-  width: 200px;
-}
 .block.progress.onepage .content > dt {
   font-size: 16px;
   font-weight: 400;
@@ -5273,10 +5313,6 @@ body {
 .order.details .block.order .payment.method .data.table td {
   padding: 5px;
 }
-.opc.wrapper {
-  float: right;
-  width: 725px;
-}
 .opc.wrapper > .opc {
   padding: 0;
   margin: 0;
@@ -5720,8 +5756,6 @@ body {
   margin: 0;
   list-style-type: none;
   list-style-image: none;
-  float: left;
-  width: 200px;
 }
 .multicheckout.progress li {
   font-size: 16px;
@@ -5731,19 +5765,6 @@ body {
 .multicheckout.progress li.active {
   font-weight: bold;
 }
-.multicheckout.progress + .form.address.edit {
-  float: right;
-  width: 725px;
-}
-.multicheckout.form.address,
-.multicheckout.form.billing,
-.multicheckout.form.shipping,
-.multicheckout.form.overview,
-.multicheckout.success,
-.multicheckout.change.billing {
-  float: right;
-  width: 725px;
-}
 .multicheckout .title {
   *zoom: 1;
   margin: 0 0 30px;
@@ -6012,11 +6033,6 @@ body {
 .multicheckout.form.address .control.address select {
   max-width: 450px;
 }
-.checkout-multishipping-address-newshipping .form.address.edit,
-.checkout-multishipping-address-editshipping .form.address.edit {
-  float: right;
-  width: 725px;
-}
 .block.gift.message {
   margin: 30px 0 0;
 }
@@ -7193,6 +7209,10 @@ body {
   text-align: center;
   padding: 0 4px;
 }
+.action.showcart .qty:before,
+.action.showcart .qty:after {
+  content: "";
+}
 .action.showcart .qty.empty {
   display: none;
 }
@@ -7560,6 +7580,10 @@ span.widget.link {
 .data.comparison .cell.attribute {
   font-size: 12px;
 }
+.data.comparison .cell.attribute img {
+  max-width: 100%;
+  height: auto;
+}
 .data.comparison td:last-child {
   border-right: 1px solid #e5e5e5;
 }
@@ -7899,11 +7923,15 @@ span.widget.link {
 .sidebar .minilist.products.items .item.product {
   margin: 0 0 20px;
   padding: 0;
-  position: relative;
   width: 100%;
+  position: relative;
+  z-index: 1;
 }
 .sidebar .minilist.products.items .item.product .product.actions {
   visibility: hidden;
+  -webkit-transition: visibility 0.01s ease-in-out 0.1s;
+  -moz-transition: visibility 0.01s ease-in-out 0.1s;
+  transition: visibility 0.01s ease-in-out 0.1s;
 }
 .sidebar .minilist.products.items .item.product:hover .product.actions {
   visibility: visible;
@@ -7920,7 +7948,11 @@ span.widget.link {
   overflow: hidden;
 }
 .sidebar .minilist.products.items .actions {
-  bottom: 0;
+  /*        */
+
+}
+.sidebar .minilist.products.items .primary {
+  bottom: -10px;
   left: 0;
   position: absolute;
 }
@@ -7928,6 +7960,12 @@ span.widget.link {
   padding: 5px 11px;
   display: inline-block;
 }
+.sidebar .minilist.products.items .secondary {
+  position: absolute;
+  left: 100%;
+  margin-left: -5px;
+  top: 0;
+}
 .block.widget.photos {
   margin: 0 0 30px;
 }
@@ -8430,6 +8468,10 @@ span.widget.link {
   margin-bottom: 20px;
 }
 .products.wrapper.grid .products.list .item.product {
+  -moz-box-sizing: border-box;
+  -webkit-box-sizing: border-box;
+  -ms-box-sizing: border-box;
+  box-sizing: border-box;
   float: left;
   width: 16.666666666666664%;
   margin-right: 0%;
@@ -9070,6 +9112,10 @@ span.widget.link {
 .product.attibute.sku .type:after {
   content: '#';
 }
+.product.attibute.description img {
+  max-width: 100%;
+  height: auto;
+}
 @media only screen and (max-width: 99999px) {
   .product.data {
     float: left;
@@ -10758,22 +10804,17 @@ img[align="right"] {
   padding-right: 20px;
   float: left;
 }
-.form.send.friend .fieldset.recipients .fields .action.delete {
+.form.send.friend .fieldset.recipients .action.delete {
   position: absolute;
   right: 0;
   top: 50%;
 }
-.form.send.friend .actions > .primary {
-  float: right;
-  text-align: right;
-}
-.form.send.friend .actions > .primary .action.submit {
-  float: right;
-  margin-left: 10px;
-}
-.form.send.friend .actions > .primary .limit {
+.form.send.friend .fieldset.recipients .actions {
+  width: 100%;
   margin: 0;
-  display: inline-block;
+}
+.form.send.friend .fieldset.recipients .actions .primary {
+  float: left;
 }
 .form.address.edit .field.company,
 .form.edit.account .field.password.current,
@@ -11193,61 +11234,69 @@ img[align="right"] {
 .data.table.reviews .product.name {
   margin: 0;
 }
+/*
+    Wishlist sidebar
+-------------------------------------- */
+.block.wishlist .subtitle {
+  display: block;
+  font-weight: 600;
+  margin: 0 0 15px;
+}
 /*
     My Account -> My Wishlist
 -------------------------------------- */
-.data.table.wishlist {
+.wrapper.table .data.table.wishlist {
   margin-bottom: 15px;
 }
-.data.table.wishlist thead th {
+.wrapper.table .data.table.wishlist thead th {
   padding-top: 0;
   padding-bottom: 10px;
   text-align: left;
   font-weight: 400;
   font-size: 16px;
 }
-.data.table.wishlist td,
-.data.table.wishlist th {
+.wrapper.table .data.table.wishlist td,
+.wrapper.table .data.table.wishlist th {
   padding: 16px 10px 10px;
   vertical-align: top;
 }
-.data.table.wishlist td:first-child,
-.data.table.wishlist th:first-child {
+.wrapper.table .data.table.wishlist td:first-child,
+.wrapper.table .data.table.wishlist th:first-child {
   padding-left: 20px;
 }
-.data.table.wishlist td:last-child,
-.data.table.wishlist th:last-child {
+.wrapper.table .data.table.wishlist td:last-child,
+.wrapper.table .data.table.wishlist th:last-child {
   padding-right: 20px;
 }
-.data.table.wishlist tbody tr:nth-child(even) {
+.wrapper.table .data.table.wishlist tbody tr:nth-child(even) {
   background: #f8f8f8;
 }
-.data.table.wishlist textarea {
+.wrapper.table .data.table.wishlist textarea {
   width: 100%;
 }
-.data.table.wishlist .box.tocart .qty {
+.wrapper.table .data.table.wishlist .box.tocart .qty {
   width: 50px;
 }
-.data.table.wishlist + .actions .primary {
-  margin-bottom: 15px;
-}
-.data.table.wishlist + .actions .primary .action.share,
-.data.table.wishlist + .actions .primary .action.update {
-  padding: 5px 11px;
-}
-.data.table.wishlist + .actions .primary .action.update {
-  margin-left: 5px;
-}
-.data.table.wishlist .col.photo {
+.wrapper.table .data.table.wishlist .col.photo {
   width: 100px;
 }
-.data.table.wishlist .col.actions {
+.wrapper.table .data.table.wishlist .col.actions {
   width: 200px;
 }
-.data.table.wishlist .col.actions .price-excluding-tax,
-.data.table.wishlist .col.actions .price-including-tax {
+.wrapper.table .data.table.wishlist .col.actions .price-excluding-tax,
+.wrapper.table .data.table.wishlist .col.actions .price-including-tax {
   display: block;
 }
+.wrapper.table + .actions .primary {
+  margin-bottom: 15px;
+}
+.wrapper.table + .actions .primary .action.share,
+.wrapper.table + .actions .primary .action.update {
+  padding: 5px 11px;
+}
+.wrapper.table + .actions .primary .action.update {
+  margin-left: 5px;
+}
 /*
     Page -> Advanced Search
 -------------------------------------- */
@@ -11904,6 +11953,20 @@ img[align="right"] {
 }
 /* Smartphones (portrait) ----------- */
 @media only screen and (max-width: 640px) {
+  .scrollTable .wrapper.table,
+  .sales-order-history .wrapper.table,
+  .review-customer-index .wrapper.table,
+  .sales-order-view .wrapper.table,
+  .sales-order-invoice .wrapper.table,
+  .sales-order-shipment .wrapper.table,
+  .sales-order-creditmemo .wrapper.table,
+  .checkout-onepage-index .order-review .wrapper.table,
+  .downloadable-customer-products .wrapper.table,
+  .form.wishlist.items .wrapper.table,
+  .block.dashboard.orders .wrapper.table,
+  .block.billing.agreements .wrapper.table {
+    overflow-x: auto;
+  }
   html {
     height: 100%;
   }
@@ -12423,9 +12486,6 @@ img[align="right"] {
     float: none;
     margin-bottom: 30px;
   }
-  .footer .block.newsletter input[type="text"] {
-    height: 33px;
-  }
   .footer .links {
     width: 45%;
     margin: 0 5% 0 0;
@@ -12549,6 +12609,7 @@ img[align="right"] {
     max-width: 100%;
   }
   .cart.main.actions {
+    text-align: center;
     *zoom: 1;
   }
   .cart.main.actions:before,
@@ -12559,8 +12620,7 @@ img[align="right"] {
   .cart.main.actions:after {
     clear: both;
   }
-  .cart.main.actions .action.update,
-  .cart.main.actions .action.continue {
+  .cart.main.actions .action.update {
     -moz-box-sizing: border-box;
     -webkit-box-sizing: border-box;
     -ms-box-sizing: border-box;
@@ -12578,9 +12638,9 @@ img[align="right"] {
     border: none;
     background-color: #c2c2c2;
     color: #ffffff;
+    margin-top: 15px;
   }
-  .cart.main.actions .action.update span,
-  .cart.main.actions .action.continue span {
+  .cart.main.actions .action.update span {
     font-size: 18px;
   }
   .cart.main.actions .action.continue {
@@ -12930,7 +12990,6 @@ img[align="right"] {
     font-size: 16px;
   }
   .opc.wrapper .order-review .review.table.wrapper {
-    overflow-x: scroll;
     margin-bottom: 10px;
   }
   .opc.wrapper .order-review .order.review.data th,
@@ -13555,15 +13614,8 @@ img[align="right"] {
     width: 100%;
     margin-left: 0;
   }
-  .form.send.friend .actions > .primary {
-    float: none;
-  }
-  .form.send.friend .actions > .primary .action.submit {
+  .form.send.friend .fieldset.recipients .actions .primary {
     float: none;
-    margin-left: 0;
-  }
-  .form.send.friend .actions > .primary .action.add {
-    margin-top: 10px;
   }
   /*
       *    Mage_Customer
@@ -13576,38 +13628,77 @@ img[align="right"] {
     float: none;
   }
   .col2-left-layout.account .column.left {
+    border-top: 4px solid #e5e5e5;
     display: block;
     width: 100%;
     float: none;
     margin-top: 20px;
+    padding-top: 20px;
   }
+  .accountActions .primary,
+  .accountActions .secondary,
   .account .column.main .my-account .actions .primary,
-  .account .column.main .block .actions .primary,
-  .account .column.main .form .actions .primary,
   .account .column.main .my-account .actions .secondary,
+  .account .column.main .block .actions .primary,
   .account .column.main .block .actions .secondary,
-  .account .column.main .form .actions .secondary {
+  .account .column.main .form .actions .primary,
+  .account .column.main .form .actions .secondary,
+  .account .column.main > .actions .primary,
+  .account .column.main > .actions .secondary {
     float: none;
   }
+  .accountActions .primary .action,
+  .account .column.main .my-account .actions .primary .action,
+  .account .column.main .block .actions .primary .action,
+  .account .column.main .form .actions .primary .action,
+  .account .column.main > .actions .primary .action {
+    -moz-box-sizing: border-box;
+    -webkit-box-sizing: border-box;
+    -ms-box-sizing: border-box;
+    box-sizing: border-box;
+    display: block;
+    margin: 0 auto 15px;
+    padding: 10px;
+    width: 100%;
+    max-width: 100%;
+    line-height: 1;
+    float: none;
+    text-align: center;
+    text-decoration: none;
+    text-transform: uppercase;
+    border: none;
+    background-color: #da370a;
+    color: #ffffff;
+  }
+  .accountActions .primary .action span,
+  .account .column.main .my-account .actions .primary .action span,
+  .account .column.main .block .actions .primary .action span,
+  .account .column.main .form .actions .primary .action span,
+  .account .column.main > .actions .primary .action span {
+    font-size: 18px;
+  }
+  .accountActions .secondary,
   .account .column.main .my-account .actions .secondary,
   .account .column.main .block .actions .secondary,
-  .account .column.main .form .actions .secondary {
+  .account .column.main .form .actions .secondary,
+  .account .column.main > .actions .secondary {
     margin-bottom: 15px;
   }
+  .accountActions .secondary .action.back,
   .account .column.main .my-account .actions .secondary .action.back,
   .account .column.main .block .actions .secondary .action.back,
-  .account .column.main .form .actions .secondary .action.back {
+  .account .column.main .form .actions .secondary .action.back,
+  .account .column.main > .actions .secondary .action.back {
     display: block;
     float: none;
-    text-align: left;
+    text-align: center;
   }
   .account > .block,
   .account .my-account > .block {
     margin-bottom: 20px;
   }
   .billing-agreements > .actions,
-  .recurring-profiles .buttons-set,
-  .newsletter.manage > .actions {
+  .recurring-profiles .buttons-set {
     text-align: center;
     margin-bottom: 20px;
   }
@@ -13666,9 +13757,6 @@ img[align="right"] {
   .block.dashboard .recent.orders .col.shipping {
     display: none;
   }
-  .block.dashboard.orders {
-    overflow-x: scroll;
-  }
   .block.dashboard:not(.welcome):not(.orders) .content {
     padding: 20px;
     margin: 0 -20px;
@@ -13711,7 +13799,26 @@ img[align="right"] {
     width: 100%;
   }
   .form.newsletter .action.save {
+    -moz-box-sizing: border-box;
+    -webkit-box-sizing: border-box;
+    -ms-box-sizing: border-box;
+    box-sizing: border-box;
+    display: block;
+    margin: 0 auto 15px;
+    padding: 10px;
     width: 100%;
+    max-width: 100%;
+    line-height: 1;
+    float: none;
+    text-align: center;
+    text-decoration: none;
+    text-transform: uppercase;
+    border: none;
+    background-color: #da370a;
+    color: #ffffff;
+  }
+  .form.newsletter .action.save span {
+    font-size: 18px;
   }
   .account .column.main .tags.items.cloud .item {
     font-size: 18px;
@@ -13736,59 +13843,22 @@ img[align="right"] {
     padding-top: 7px;
     padding-bottom: 6px;
   }
-  /*
-       My Account -> Downloadable products
-       -------------------------------------- */
-  .downloadable-customer-products .column.main {
-    overflow-x: scroll;
-  }
-  /*
-      My Account -> My Reviews
-      -------------------------------------- */
-  .review-customer-index .column.main {
-    overflow-x: scroll;
-  }
   /*
       My Account -> Wishlist
       -------------------------------------- */
-  .account .form.wishlist.items .wishlist.table.wrapper {
-    overflow-x: scroll;
+  .account .form.wishlist.items .data.table.wishlist {
+    margin-bottom: 0;
   }
-  .account .form.wishlist.items .wishlist.table.wrapper thead {
+  .account .form.wishlist.items .data.table.wishlist thead {
     display: none;
   }
-  .account .form.wishlist.items .wishlist.table.wrapper textarea {
+  .account .form.wishlist.items .data.table.wishlist textarea {
     width: 15em;
   }
-  .account .form.wishlist.items .actions .primary .action {
-    -moz-box-sizing: border-box;
-    -webkit-box-sizing: border-box;
-    -ms-box-sizing: border-box;
-    box-sizing: border-box;
-    display: block;
-    margin: 0 auto 15px;
-    padding: 10px;
-    width: 100%;
-    max-width: 100%;
-    line-height: 1;
-    float: none;
-    text-align: center;
-    text-decoration: none;
-    text-transform: uppercase;
-    border: none;
-    background-color: #da370a;
-    color: #ffffff;
-  }
-  .account .form.wishlist.items .actions .primary .action span {
-    font-size: 18px;
-  }
   /*
      *    My Account -> My orders
      *
     ----------------------------------------------------------------------------- */
-  .sales-order-history .column.main {
-    overflow-x: scroll;
-  }
   .order.details .order.toolbar {
     clear: both;
     float: none;
@@ -13842,8 +13912,11 @@ img[align="right"] {
   .order.details > .actions {
     margin-bottom: 20px;
   }
-  .order.details.items {
-    overflow-x: scroll;
+  .order.details .wrapper.table {
+    margin-bottom: 45px;
+  }
+  .order.details .wrapper.table .data.table.order {
+    margin-bottom: 0;
   }
   .widget.static.block {
     margin-bottom: 15px;
@@ -13907,20 +13980,20 @@ img[align="right"] {
   .product.photo .notice {
     display: none;
   }
-  .product.info.main .page.title.product {
+  .product.info.additional .page.title.product {
     margin-bottom: 10px;
   }
+  .product.info.additional .stock {
+    margin: 15px 0;
+  }
+  .product.info.main.responsive .page.title,
+  .product.info.main.responsive .stock:not(.alert) {
+    display: none;
+  }
   .product.info.main .price-box {
     border: none !important;
     margin: 0;
   }
-  .product.info.main .stock {
-    clear: right;
-    float: right;
-  }
-  .product.info.main .stock.alert {
-    float: none;
-  }
   .product.info.main .prices.tier {
     clear: both;
   }
@@ -14021,6 +14094,20 @@ img[align="right"] {
     width: 100%;
     clear: both;
   }
+  .catalog-product-view .column.main {
+    display: -webkit-flex;
+    display: -ms-flexbox;
+    display: flex;
+    -webkit-flex-direction: column;
+    -ms-flex-direction: column;
+    flex-direction: column;
+  }
+  .catalog-product-view .column.main .product.info.additional,
+  .catalog-product-view .column.main .product.media {
+    -webkit-order: -1;
+    -ms-flex-order: -1;
+    order: -1;
+  }
   .product.media .img.photo.container {
     height: auto !important;
     width: auto !important;
@@ -14282,7 +14369,8 @@ img[align="right"] {
     margin: 0 0 10px;
   }
   input[type="password"],
-  input[type="text"] {
+  input[type="text"],
+  input[type="number"] {
     font-size: 18px;
   }
   .fieldset > .field > .label {
@@ -14517,8 +14605,7 @@ img[align="right"] {
     font-size: 18px;
   }
   /*
-      Magento_Catalog
-      Compare
+      Magento_Catalog Compare
   -------------------------------------- */
   .catalog-product-compare-index .action.print {
     margin: -20px 0 20px;
diff --git a/app/design/frontend/magento_plushe/i18n/en_US.csv b/app/design/frontend/magento_plushe/i18n/en_US.csv
new file mode 100644
index 0000000000000000000000000000000000000000..062b8524da10b28d63820646c9af9896d7d6f3d0
--- /dev/null
+++ b/app/design/frontend/magento_plushe/i18n/en_US.csv
@@ -0,0 +1,4 @@
+"%1 items","%1"
+"1 item","1"
+"My Cart (1 item)","My Cart (1)"
+"My Cart (%1 items)","My Cart (%1)"
diff --git a/app/design/frontend/magento_plushe/js/matchMedia.js b/app/design/frontend/magento_plushe/js/matchMedia.js
index 68ee4e2b813dfbed7b1a628203b82570744ff68a..8960bf12efae1414c736f5517db80099a07b6972 100644
--- a/app/design/frontend/magento_plushe/js/matchMedia.js
+++ b/app/design/frontend/magento_plushe/js/matchMedia.js
@@ -58,19 +58,19 @@ window.matchMedia = window.matchMedia || (function( doc, undefined ) {
 /*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. Dual MIT/BSD license */
 (function(){
   // monkeypatch unsupported addListener/removeListener with polling
-  if( !window.matchMedia( "" ).addListener ){
+  if( !window.matchMedia( "all" ).addListener ){
     var oldMM = window.matchMedia;
-    
+
     window.matchMedia = function( q ){
       var ret = oldMM( q ),
         listeners = [],
-        last = false,
+        last = ret.matches,
         timer,
         check = function(){
           var list = oldMM( q ),
             unmatchToMatch = list.matches && !last,
             matchToUnmatch = !list.matches && last;
-                                                
+
                                         //fire callbacks only if transitioning to or from matched state
           if( unmatchToMatch || matchToUnmatch ){
             for( var i =0, il = listeners.length; i< il; i++ ){
@@ -97,7 +97,7 @@ window.matchMedia = window.matchMedia || (function( doc, undefined ) {
           clearInterval( timer );
         }
       };
-      
+
       return ret;
     };
   }
@@ -105,7 +105,7 @@ window.matchMedia = window.matchMedia || (function( doc, undefined ) {
 
 var mediaCheck = function( options ) {
   var mq,
-      matchMedia = (window.matchMedia !== undefined & window.matchMedia('').addListener !== undefined);
+      matchMedia = (window.matchMedia !== undefined & window.matchMedia("all").addListener !== undefined);
       
   mqChange = function( mq, options ) {
     if ( mq.matches ) {
diff --git a/app/design/frontend/magento_plushe/js/navigation-menu.js b/app/design/frontend/magento_plushe/js/navigation-menu.js
index 20856c3df592fb312b21de70c9ab1075f0b6ba36..fa8f9b08040f831499d304bb0edb520c61bdc6f4 100644
--- a/app/design/frontend/magento_plushe/js/navigation-menu.js
+++ b/app/design/frontend/magento_plushe/js/navigation-menu.js
@@ -33,7 +33,7 @@
             topLevelHoverClass: 'hover',
             expandedTopLevel: '.more',
             hoverInTimeout: 300,
-            hoverOutTimeout: 2000,
+            hoverOutTimeout: 500,
             submenuAnimationSpeed: 200,
             collapsable: true,
             collapsableDropdownTemplate:
diff --git a/app/design/frontend/magento_plushe/js/responsive.js b/app/design/frontend/magento_plushe/js/responsive.js
index a85048b0ce3bf3e09e9aa42cbbdd0f721e7167e2..c216bd60f992649c52085e0c17e79a0754dbe686 100644
--- a/app/design/frontend/magento_plushe/js/responsive.js
+++ b/app/design/frontend/magento_plushe/js/responsive.js
@@ -55,12 +55,55 @@
                         $('#checkout-progress-wrapper .content').toggle();
                     });
 
+                (function() {
+                    var productInfoMain = $('.product.info.main'),
+                        productInfoAdditional = $("#product-info-additional");
+
+                    if(!productInfoAdditional.length) {
+
+                        var productTitle = productInfoMain.find(".page.title.product").clone(),
+                            productStock = productInfoMain.find(".stock:not(.alert)").clone();
+
+                        productInfoAdditional = $("<div/>", {
+                            id: "product-info-additional",
+                            addClass: "product info additional"
+                        });
+
+                        $('.catalog-product-view .column.main')
+                            .prepend(productInfoAdditional);
+
+                        productInfoAdditional
+                            .append(productTitle)
+                            .append(productStock);
+
+                    } else {
+                        productInfoAdditional.removeClass("hidden");
+                    }
+
+                    productInfoMain.addClass("responsive");
+
+                })();
+
+
             },
 
             // Switch to Desktop Version
             exit: function() {
                 // minicart
                 $('.action.showcart').removeClass('is-disabled');
+
+                (function() {
+
+                    var productInfoMain = $('.product.info.main'),
+                        productInfoAdditional = $("#product-info-additional");
+
+                    if(productInfoAdditional.length) {
+                        productInfoAdditional.addClass("hidden");
+                        productInfoMain.removeClass("responsive");
+                    }
+
+                })();
+
             }
         });
     });
diff --git a/app/design/frontend/magento_plushe/less/lib/forms.less b/app/design/frontend/magento_plushe/less/lib/forms.less
index 18723a86f7be45ade3b8932d5a54a2118677b437..76db35196a8c13590f1c6d66daf0d84e3ce3f109 100644
--- a/app/design/frontend/magento_plushe/less/lib/forms.less
+++ b/app/design/frontend/magento_plushe/less/lib/forms.less
@@ -461,7 +461,8 @@ input[type="tel"],
 input[type="url"],
 input[type="email"],
 input[type="datetime"],
-input[type="password"] {
+input[type="password"],
+input[type="number"] {
     .inputText();
 }
 
@@ -474,6 +475,12 @@ input[type="reset"] {
     &:extend(.secondary.action all);
 }
 
+input[type=number]::-webkit-inner-spin-button,
+input[type=number]::-webkit-outer-spin-button {
+  -webkit-appearance: none;
+  margin: 0;
+}
+
 select {
     .controlStyling();
     padding: 5px 10px 4px;
@@ -539,7 +546,8 @@ textarea {
     input[type="url"].valid,
     input[type="email"].valid,
     input[type="datetime"].valid,
-    input[type="password"].valid {
+    input[type="password"].valid,
+    input[type="number"].valid {
         border-color: @validHilight !important;
     }
     // Validation error
@@ -551,7 +559,8 @@ textarea {
     input[type="url"].mage-error,
     input[type="email"].mage-error,
     input[type="datetime"].mage-error,
-    input[type="password"].mage-error {
+    input[type="password"].mage-error,
+    input[type="number"].mage-error {
         border-color: @nonValidHilight !important;
     }
     div.mage-error[generated] {
diff --git a/app/design/frontend/magento_plushe/less/lib/icons.less b/app/design/frontend/magento_plushe/less/lib/icons.less
index 6fde98162105c698d3a535be9c451709d1bf5db8..e0777cffb0a634ba02b124e7d6c3c2ed51372975 100644
--- a/app/design/frontend/magento_plushe/less/lib/icons.less
+++ b/app/design/frontend/magento_plushe/less/lib/icons.less
@@ -203,3 +203,21 @@
         margin: 0;
     }
 }
+
+.iconShowText() {
+    text-indent: 0;
+    line-height:inherit;
+    height:inherit;
+}
+
+.iconRemove(@position: 'after') when (@position = 'after') {
+    &:after {
+        display: none;
+    }
+}
+
+.iconRemove(@position: 'after') when (@position = 'before') {
+    &:before {
+        display: none;
+    }
+}
diff --git a/app/design/frontend/magento_plushe/less/lib/snippets.less b/app/design/frontend/magento_plushe/less/lib/snippets.less
index 65ff1c139ac782b62b7410de3adb46bbe8d36ff5..354f4c8910c2ed6d2e383fb53aa8d9b96c7052e6 100644
--- a/app/design/frontend/magento_plushe/less/lib/snippets.less
+++ b/app/design/frontend/magento_plushe/less/lib/snippets.less
@@ -139,4 +139,8 @@
     .box-sizing();
     background: @primary1;
     padding: 30px;
-}
\ No newline at end of file
+}
+
+.visuallyHidden {
+    .visually-hidden()
+}
diff --git a/app/design/frontend/magento_plushe/less/responsive/responsive.less b/app/design/frontend/magento_plushe/less/responsive/responsive.less
index 71a7681111f95a5eee27b3dbca69fab29e175a45..d6c5bfa2321069cd8b73a7d7a3f6247d902ac43e 100644
--- a/app/design/frontend/magento_plushe/less/responsive/responsive.less
+++ b/app/design/frontend/magento_plushe/less/responsive/responsive.less
@@ -120,6 +120,12 @@
 /* Smartphones (portrait) ----------- */
 @media only screen
 and (max-width : @breakPoint1) {
+    .scrollTable {
+        .wrapper.table {
+            overflow-x: auto;
+        }
+    }
+
     html {
         height: 100%;
     }
@@ -544,9 +550,6 @@ and (max-width : @breakPoint1) {
             width: 100%;
             float: none;
             margin-bottom: 30px;
-            input[type="text"] {
-                height: 33px;
-            }
         }
         .links {
             width: 45%;
@@ -670,11 +673,12 @@ and (max-width : @breakPoint1) {
     .cart {
         // Main actions
         &.main.actions {
+            text-align: center;
             .clearfix();
             .action {
-                &.update,
-                &.continue {
+                &.update {
                     .mobileSecondaryAction();
+                    margin-top: 15px;
                 }
                 &.continue {
                     position: relative;
@@ -1079,7 +1083,6 @@ and (max-width : @breakPoint1) {
         .order-review {
             font-size: 16px;
             .review.table.wrapper {
-                overflow-x: scroll;
                 margin-bottom: 10px;
             }
             .order.review.data {
@@ -1526,14 +1529,9 @@ Multishipping
     }
 
     .form.send.friend {
-        .actions > .primary {
-            .action.submit {
-                float: none;
-                margin-left: 0;
-            }
-            float: none;
-            .action.add {
-                margin-top: 10px;
+        .fieldset.recipients {
+            .actions .primary {
+                 float: none;
             }
         }
     }
@@ -1550,10 +1548,46 @@ Multishipping
             float: none;
         }
         .column.left {
+            border-top: 4px solid @primary2;
             display: block;
             width: 100%;
             float: none;
             margin-top: 20px;
+            padding-top: 20px;
+        }
+    }
+
+    .sales-order-history,
+    .review-customer-index,
+    .sales-order-view,
+    .sales-order-invoice,
+    .sales-order-shipment,
+    .sales-order-creditmemo,
+    .checkout-onepage-index .order-review,
+    .downloadable-customer-products,
+    .form.wishlist.items,
+    .block.dashboard.orders,
+    .block.billing.agreements {
+        &:extend(.scrollTable all);
+    }
+
+    .accountActions {
+        .primary,
+        .secondary {
+            float: none;
+        }
+        .primary {
+            .action {
+                .mobilePrimaryAction();
+            }
+        }
+        .secondary {
+            margin-bottom: 15px;
+            .action.back {
+                display: block;
+                float: none;
+                text-align: center;
+            }
         }
     }
 
@@ -1563,20 +1597,12 @@ Multishipping
             .block,
             .form {
                 .actions {
-                    .primary,
-                    .secondary {
-                        float: none;
-                    }
-                    .secondary {
-                        margin-bottom: 15px;
-                        .action.back {
-                            display: block;
-                            float: none;
-                            text-align: left;
-                        }
-                    }
+                    &:extend(.accountActions all);
                 }
             }
+            > .actions {
+                &:extend(.accountActions all);
+            }
         }
         > .block,
         .my-account > .block {
@@ -1585,8 +1611,7 @@ Multishipping
     }
 
     .billing-agreements > .actions,
-    .recurring-profiles .buttons-set,
-    .newsletter.manage > .actions {
+    .recurring-profiles .buttons-set {
         text-align: center;
         margin-bottom: 20px;
     }
@@ -1640,9 +1665,6 @@ Multishipping
                 display: none;
             }
         }
-        &.orders {
-            overflow-x: scroll;
-        }
     }
 
     .block.dashboard:not(.welcome):not(.orders) {
@@ -1694,7 +1716,7 @@ Multishipping
 
     .form.newsletter {
         .action.save {
-            width: 100%;
+            .mobilePrimaryAction();
         }
     }
 
@@ -1721,31 +1743,15 @@ Multishipping
             }
         }
     }
-    /*
-     My Account -> Downloadable products
-     -------------------------------------- */
-    .downloadable-customer-products {
-        .column.main {
-            overflow-x: scroll;
-        }
-    }
 
-    /*
-    My Account -> My Reviews
-    -------------------------------------- */
-    .review-customer-index {
-        .column.main {
-            overflow-x: scroll;
-        }
-    }
 
     /*
     My Account -> Wishlist
     -------------------------------------- */
     .account {
         .form.wishlist.items {
-            .wishlist.table.wrapper {
-                overflow-x: scroll;
+            .data.table.wishlist {
+                margin-bottom: 0;
                 thead {
                     display: none;
                 }
@@ -1753,13 +1759,6 @@ Multishipping
                     width: 15em;
                 }
             }
-            .actions {
-                .primary {
-                    .action {
-                        .mobilePrimaryAction();
-                    }
-                }
-            }
         }
     }
 
@@ -1767,11 +1766,7 @@ Multishipping
    *    My Account -> My orders
    *
   ----------------------------------------------------------------------------- */
-    .sales-order-history {
-        .column.main {
-            overflow-x: scroll;
-        }
-    }
+
 
     .order.details {
         .order.toolbar {
@@ -1832,8 +1827,11 @@ Multishipping
         > .actions {
             margin-bottom: 20px;
         }
-        &.items {
-            overflow-x: scroll;
+        .wrapper.table {
+            margin-bottom: 45px;
+            .data.table.order {
+                margin-bottom: 0;
+            }
         }
     }
 
@@ -1913,21 +1911,26 @@ Multishipping
         display: none;
     }
 
-    .product.info.main {
+    .product.info.additional {
         .page.title.product {
             margin-bottom: 10px;
         }
+        .stock {
+            margin: 15px 0;
+        }
+    }
+
+    .product.info.main {
+        &.responsive {
+            .page.title,
+            .stock:not(.alert) {
+                display: none;
+            }
+        }
         .price-box {
             border: none !important;
             margin: 0;
         }
-        .stock {
-            clear: right;
-            float: right;
-            &.alert {
-                float: none;
-            }
-        }
         .prices.tier  {
             clear: both;
         }
@@ -2006,6 +2009,21 @@ Multishipping
         }
     }
 
+    .catalog-product-view .column.main {
+        display: -webkit-flex;
+        display: -ms-flexbox;
+        display: flex;
+        -webkit-flex-direction: column;
+        -ms-flex-direction: column;
+        flex-direction: column;
+        .product.info.additional,
+        .product.media {
+            -webkit-order: -1;
+            -ms-flex-order: -1;
+            order: -1;
+        }
+    }
+
     .product.media {
         .img.photo.container {
             height: auto !important;
@@ -2235,7 +2253,8 @@ Multishipping
     }
 
     input[type="password"],
-    input[type="text"] {
+    input[type="text"],
+    input[type="number"] {
         font-size: 18px;
     }
 
diff --git a/app/design/frontend/magento_plushe/less/styles.less b/app/design/frontend/magento_plushe/less/styles.less
index 50038db2cb410248c0231b861b730e0163b1913d..5ff2d45413026339862d407a416efafdfe429387 100644
--- a/app/design/frontend/magento_plushe/less/styles.less
+++ b/app/design/frontend/magento_plushe/less/styles.less
@@ -276,6 +276,7 @@ body {
         border-radius: 0 0 5px 5px;
         overflow: hidden;
         z-index: 5;
+        display: none;
         ul {
             .resetList();
             li {
@@ -361,6 +362,9 @@ body {
             font-weight: @baseFontWeightLighter;
             font-size: 20px;
         }
+        .qty.counter {
+            font-size: 16px;
+        }
     }
     &.filter {
         .item {
@@ -369,6 +373,15 @@ body {
     }
 }
 
+.qty.counter {
+    &:before {
+        content: "(";
+    }
+    &:after {
+        content: ")";
+    }
+}
+
 .sidebar .block > .title strong {
     font-size: 18px;
 }
@@ -830,8 +843,6 @@ body {
     One page
 -------------------------------------- */
 .block.progress.onepage {
-    float: left;
-    width: 200px;
     .content > dt {
         font-size: @baseFontSizeBigger;
         font-weight: @baseFontWeight;
@@ -883,8 +894,6 @@ body {
 
 
 .opc.wrapper {
-    float: right;
-    width: 725px;
     > .opc {
         .resetList();
         .section {
@@ -1276,8 +1285,6 @@ body {
 .multicheckout {
     &.progress {
         .resetList();
-        float: left;
-        width: 200px;
         li {
             font-size: 16px;
             font-weight: 400;
@@ -1286,19 +1293,6 @@ body {
                 font-weight: bold;
             }
         }
-        + .form.address.edit {
-            float: right;
-            width: 725px;
-        }
-    }
-    &.form.address,
-    &.form.billing,
-    &.form.shipping,
-    &.form.overview,
-    &.success,
-    &.change.billing {
-        float: right;
-        width: 725px;
     }
     .title {
         .clearfix();
@@ -1581,14 +1575,6 @@ body {
     }
 }
 
-.checkout-multishipping-address-newshipping,
-.checkout-multishipping-address-editshipping {
-    .form.address.edit {
-        float: right;
-        width: 725px;
-    }
-}
-
 .block.gift.message {
     margin: 30px 0 0;
     .title {
@@ -2629,6 +2615,10 @@ body {
         min-height: @height;
         text-align: center;
         padding: 0 4px;
+        &:before,
+        &:after {
+            content: "";
+        }
     }
     .qty.empty {
         display: none;
@@ -2970,6 +2960,10 @@ span.widget.link {
     }
     .cell.attribute {
         font-size: @baseFontSizeMiddle;
+        img {
+            max-width: 100%;
+            height: auto;
+        }
     }
     td:last-child {
         border-right: 1px solid @primary2;
@@ -3264,12 +3258,15 @@ span.widget.link {
         width: 100%;
         .product.actions {
             visibility: hidden;
+            .transition( visibility .01s ease-in-out 0.1s );
         }
         &:hover {
             .product.actions {
                 visibility: visible;
             }
         }
+        position: relative;
+        z-index: 1;
     }
     .product.details {
         overflow: hidden;
@@ -3283,7 +3280,10 @@ span.widget.link {
         overflow: hidden;
     }
     .actions {
-        bottom: 0;
+/*        */
+    }
+    .primary {
+        bottom: -10px;
         left: 0;
         position: absolute;
     }
@@ -3292,6 +3292,12 @@ span.widget.link {
         padding: 5px 11px;
         display: inline-block;
     }
+    .secondary {
+        position: absolute;
+        left:100%;
+        margin-left: -5px;
+        top:0;
+    }
 }
 
 // Images only template
@@ -3723,6 +3729,7 @@ span.widget.link {
 
 .products.wrapper.grid .products.list {
     .item.product {
+        .box-sizing();
         @total-columns: 10;
         .column(2);
         display: inline-block;
@@ -4110,6 +4117,13 @@ span.widget.link {
     }
 }
 
+.product.attibute.description {
+    img {
+        max-width: 100%;
+        height: auto;
+    }
+}
+
 @media only screen
 and (max-width : 99999px) {
     .product.data {
@@ -4733,26 +4747,21 @@ img[align="right"] {
                 padding-right: 20px;
                 float: left;
             }
-            .action.delete {
-                position: absolute;
-                right: 0;
-                top: 50%;
-            }
-        }
-    }
-    .actions > .primary {
-        .action.submit {
-            float: right;
-            margin-left: 10px;
         }
-        float: right;
-        text-align: right;
-        .action.add {
-            &:extend(.secondary.action all);
+        .action.delete {
+            position: absolute;
+            right: 0;
+            top: 50%;
         }
-        .limit {
+        .actions {
+            width: 100%;
             margin: 0;
-            display: inline-block;
+            .action.add {
+                &:extend(.secondary.action all);
+            }
+            .primary {
+                float: left;
+            }
         }
     }
 }
@@ -5161,51 +5170,74 @@ img[align="right"] {
     }
 }
 
+/*
+    Wishlist sidebar
+-------------------------------------- */
+.block.wishlist {
+    .subtitle {
+        display: block;
+        font-weight: 600;
+        margin: 0 0 15px;
+    }
+}
+
 /*
     My Account -> My Wishlist
 -------------------------------------- */
-.data.table.wishlist {
-    @optionsBg: rgba(0, 0, 0, .8);
-    @optionsColor: #fff;
+.wrapper.table {
+    .data.table.wishlist {
+        @optionsBg: rgba(0, 0, 0, .8);
+        @optionsColor: #fff;
 
-    margin-bottom: 15px;
+        margin-bottom: 15px;
 
-    thead th {
-        padding-top: 0;
-        padding-bottom: 10px;
-        text-align: left;
-        font-weight: @baseFontWeight;
-        font-size: @baseFontSizeBigger;
-    }
+        thead th {
+            padding-top: 0;
+            padding-bottom: 10px;
+            text-align: left;
+            font-weight: @baseFontWeight;
+            font-size: @baseFontSizeBigger;
+        }
 
-    td,
-    th {
-        padding: 16px 10px 10px;
-        vertical-align: top;
-    }
+        td,
+        th {
+            padding: 16px 10px 10px;
+            vertical-align: top;
+        }
 
-    td:first-child,
-    th:first-child {
-        padding-left: 20px;
-    }
+        td:first-child,
+        th:first-child {
+            padding-left: 20px;
+        }
 
-    td:last-child,
-    th:last-child {
-        padding-right: 20px;
-    }
+        td:last-child,
+        th:last-child {
+            padding-right: 20px;
+        }
 
-    tbody tr:nth-child(even) {
-        background: @primary1;
-    }
+        tbody tr:nth-child(even) {
+            background: @primary1;
+        }
 
-    textarea {
-        width: 100%;
-    }
+        textarea {
+            width: 100%;
+        }
 
-    .box.tocart .qty {
-        width: 50px;
-    }
+        .box.tocart .qty {
+            width: 50px;
+        }
 
+        .col.photo {
+            width: 100px;
+        }
+        .col.actions {
+            width: 200px;
+            .price-excluding-tax,
+            .price-including-tax {
+                display: block;
+            }
+        }
+    }
     & + .actions {
         .primary {
             margin-bottom: 15px;
@@ -5219,19 +5251,7 @@ img[align="right"] {
             }
         }
     }
-
-    .col.photo {
-        width: 100px;
-    }
-    .col.actions {
-        width: 200px;
-        .price-excluding-tax,
-        .price-including-tax {
-            display: block;
-        }
-    }
 }
-
 /*
     Page -> Advanced Search
 -------------------------------------- */
@@ -5801,4 +5821,4 @@ img[align="right"] {
     }
 }
 
-@import "/responsive/responsive.less";
+@import "responsive/responsive.less";
diff --git a/dev/shell/cron.sh b/dev/shell/cron.sh
index fc0c4480995f800353f6951e65717d03b730b4d5..66f43721dcfa58a3f6b364d56d8e8f3d111d6a52 100755
--- a/dev/shell/cron.sh
+++ b/dev/shell/cron.sh
@@ -3,13 +3,13 @@
 if [ ! "$1" = "" ] ; then
 CRONSCRIPT=$1
 else
-CRONSCRIPT=../../pub/cron.php
+CRONSCRIPT=pub/cron.php
 fi
 
 PHP_BIN=`which php`
 
 # absolute path to magento installation
-INSTALLDIR=`echo $0 | sed 's/cron\.sh//g'`"../"
+INSTALLDIR=`echo $0 | sed 's/cron\.sh//g'`"../../"
 
 # prepend the intallation path if not given an absolute path
 if [ "$INSTALLDIR" != "" -a "`expr index $CRONSCRIPT /`" != "1" ];then
diff --git a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php
index 06722a03bd150b50c868f4cc7b64302eeb9fd6f6..b06248e2abf284af00619e10f8ecb54225c067d6 100644
--- a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php
+++ b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php
@@ -129,6 +129,7 @@ abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase
     public function xmlConfigFileProvider()
     {
         $fileList = $this->getXmlConfigFiles();
+        $result = array();
         foreach ($fileList as $fileContent) {
             $result[] = array($fileContent);
         }
@@ -146,7 +147,7 @@ abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase
         $directory = $objectManager->get('Magento\Filesystem')->getDirectoryRead(\Magento\Filesystem::MODULES);
         return $objectManager->get('\Magento\Config\FileIteratorFactory')->create(
             $directory,
-            $directory->search($this->_getConfigFilePathRegex())
+            $directory->search($this->_getConfigFilePathGlob())
         );
     }
 
@@ -164,7 +165,7 @@ abstract class AbstractConfigFiles extends \PHPUnit_Framework_TestCase
      *
      * @return string
      */
-    protected abstract function _getConfigFilePathRegex();
+    protected abstract function _getConfigFilePathGlob();
 
     /**
      * Returns a path to the per file XSD file, relative to the modules directory.
diff --git a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/System/StoreTest.php b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/System/StoreTest.php
index cad3f0142007fc6f87191b5eae286d41318734ca..8e4daa006b8785ac78575667c43d89a548e1197c 100644
--- a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/System/StoreTest.php
+++ b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/System/StoreTest.php
@@ -43,4 +43,31 @@ class StoreTest extends \Magento\Backend\Utility\Controller
         $this->assertSelectCount('#add_group.disabled', 0, $response);
         $this->assertSelectCount('#add_store.disabled', 0, $response);
     }
+
+    public function testSaveActionWithExistCode()
+    {
+        /** @var $formKey \Magento\Data\Form\FormKey */
+        $formKey = $this->_objectManager->get('Magento\Data\Form\FormKey');
+        $post = array(
+            'form_key' => $formKey->getFormKey(),
+            'website' => array(
+                'name' => 'base',
+                'code' => 'base',
+                'sort_order' => '',
+                'is_default' => '',
+                'website_id' => '',
+            ),
+            'store_type' => 'website',
+            'store_action' => 'add'
+        );
+        $this->getRequest()->setServer(array('REQUEST_METHOD' => 'POST'));
+        $this->getRequest()->setPost($post);
+        $this->dispatch('backend/admin/system_store/save');
+        //Check that errors was generated and set to session
+        $this->assertSessionMessages(
+            $this->contains("Website with the same code already exists."),
+            \Magento\Message\MessageInterface::TYPE_ERROR,
+            'Magento\Message\ManagerInterface'
+        );
+    }
 }
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php
index ec0fbae625cbe75f8e56dabd6f91aad1cb2ddcc5..d07e8af35e9034464d7a614ef795d39221d2dc40 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php
@@ -149,4 +149,26 @@ class ProductTest extends \Magento\Backend\Utility\Controller
         $this->assertSelectCount('#save-split-button-duplicate-button', 1, $body,
             '"Save & Duplicate" button isn\'t present on Edit Product page');
     }
+
+    /**
+     * Assure that no DDL operations, like table truncation, are executed in transaction during search results reset.
+     *
+     * @magentoDataFixture Magento/Catalog/_files/product_simple.php
+     */
+    public function testMassStatusAction()
+    {
+        $this->dispatch(
+            '/backend/catalog/product/massStatus/store/0/?product=1&massaction_prepare_key=product&status=0'
+        );
+        /** @var $objectManager \Magento\TestFramework\ObjectManager */
+        $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
+        /** @var $processCollection \Magento\Index\Model\Resource\Process\Collection */
+        $processCollection = $objectManager->get('Magento\Index\Model\Resource\Process\Collection');
+        $processCollection = $processCollection->addEventsStats()->addFilter('indexer_code', 'catalogsearch_fulltext');
+        $process = $processCollection->getLastItem();
+        /** @var $eventCollection \Magento\Index\Model\Resource\Event\Collection */
+        $eventCollection = $objectManager->get('Magento\Index\Model\Resource\Event\Collection');
+        $eventCollection->addProcessFilter($process);
+        $this->assertNull($eventCollection->getLastItem()->getData('process_event_status'));
+    }
 }
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php
index 141461b1ac6fd44d9c27794358b3032e1b1b2574..d46090ecb2c95267a7b3621b491f9fad7c52212d 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php
@@ -35,11 +35,14 @@ class CompareTest extends \Magento\TestFramework\TestCase\AbstractController
     public function testAddAction()
     {
         $this->_requireVisitorWithNoProducts();
+        $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
+        /** @var \Magento\Data\Form\FormKey $formKey */
+        $formKey = $objectManager->get('Magento\Data\Form\FormKey');
 
-        $this->dispatch('catalog/product_compare/add/product/1?nocookie=1');
+        $this->dispatch('catalog/product_compare/add/product/1/form_key/' . $formKey->getFormKey() . '?nocookie=1');
 
         /** @var $messageManager \Magento\Message\Manager */
-        $messageManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Message\Manager');
+        $messageManager = $objectManager->get('Magento\Message\Manager');
         $this->assertInstanceOf('Magento\Message\Success', $messageManager->getMessages()->getLastAddedMessage());
         $this->assertContains('Simple Product 1 Name',
             (string)$messageManager->getMessages()->getLastAddedMessage()->getText());
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php
index 93e876159f133d97e79df65b90cac417117d0378..ea2a717c36a89f1a2f94ae032fbac85253847b76 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php
@@ -127,28 +127,36 @@ class MediaTest extends \PHPUnit_Framework_TestCase
      */
     public function testBeforeSave()
     {
+        $fileName = 'magento_image.jpg';
+        $fileLabel = 'Magento image';
         /** @var $product \Magento\Catalog\Model\Product */
         $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
             ->create('Magento\Catalog\Model\Product');
         $product->setData('media_gallery', array('images' => array(
-            'image'   => array('file' => 'magento_image.jpg'),
+            'image' => array(
+                'file' => $fileName,
+                'label' => $fileLabel,
+            ),
         )));
-
+        $product->setData('image', $fileName);
         $this->_model->beforeSave($product);
         $this->assertStringStartsWith('./magento_image', $product->getData('media_gallery/images/image/new_file'));
+        $this->assertEquals($fileLabel, $product->getData('image_label'));
 
         $product->setIsDuplicate(true);
         $product->setData('media_gallery', array('images' => array(
-            'image'     => array(
-                'value_id'  => '100',
-                'file'      => 'magento_image.jpg'
-            )
+            'image' => array(
+                'value_id' => '100',
+                'file' => $fileName,
+                'label' => $fileLabel,
+            ),
         )));
         $this->_model->beforeSave($product);
         $this->assertStringStartsWith('./magento_image', $product->getData('media_gallery/duplicate/100'));
+        $this->assertEquals($fileLabel, $product->getData('image_label'));
 
         /* affect of beforeSave */
-        $this->assertNotEquals('magento_image.jpg', $this->_model->getRenamedImage('magento_image.jpg'));
+        $this->assertNotEquals($fileName, $this->_model->getRenamedImage($fileName));
         $this->assertEquals('test.jpg', $this->_model->getRenamedImage('test.jpg'));
     }
 
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Resource/Category/FlatTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Resource/Category/FlatTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..e7bdd53de9231f6f1cfe67d35abe5e55a95f8d98
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Resource/Category/FlatTest.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+namespace Magento\Catalog\Model\Resource\Category;
+
+class FlatTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var \Magento\Catalog\Model\Resource\Category\Flat
+     */
+    protected $model;
+
+    /**
+     * @var \Magento\TestFramework\ObjectManager
+     */
+    protected $objectManager;
+
+    protected function setUp()
+    {
+        $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
+        $this->model = $this->objectManager->create('Magento\Catalog\Model\Resource\Category\Flat');
+    }
+
+    /**
+     * @magentoConfigFixture current_store catalog/frontend/flat_catalog_category 1
+     */
+    public function testGetParentDesignCategory()
+    {
+        $category = $this->objectManager->create('Magento\Catalog\Model\Category');
+        $category->setId(3)
+            ->setName('Category 1')
+            ->setParentId(2)
+            ->setPath('1/2/3')
+            ->setLevel(2)
+            ->setAvailableSortBy('name')
+            ->setDefaultSortBy('name')
+            ->setIsActive(true)
+            ->setPosition(1)
+            ->save();
+        $designCategory = $this->model->getParentDesignCategory($category);
+        $this->assertInstanceOf('\Magento\Catalog\Model\Category', $designCategory, 'Invalid type for category');
+        $this->assertContains($designCategory->getId(), array(1, 2, 3), 'Incorrect data for parent design category');
+    }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/UrlTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/UrlTest.php
index d3d8adf92c1a37bb2f2d1e87a0fc93fad0cd2a68..c4f2f4ddfeb767e299b7620454bcca975fc70d06 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Model/UrlTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/UrlTest.php
@@ -230,11 +230,4 @@ class UrlTest extends \PHPUnit_Framework_TestCase
     {
         $this->assertEquals($result, $this->_model->generatePath($type, $product, $category, $parentPath));
     }
-
-    public function testGenerateUniqueIdPath()
-    {
-        $path = $this->_model->generateUniqueIdPath();
-        $this->assertNotEmpty($path);
-        $this->assertContains('_', $path);
-    }
 }
diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/DesignTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/DesignTest.php
index 9581464cae359ecc5d4dca543f2e16bdab0c78e9..459820b648398e36f3785f892241a9af0d2948ca 100644
--- a/dev/tests/integration/testsuite/Magento/Core/Model/DesignTest.php
+++ b/dev/tests/integration/testsuite/Magento/Core/Model/DesignTest.php
@@ -128,6 +128,7 @@ class DesignTest extends \PHPUnit_Framework_TestCase
 
         $cacheId = 'design_change_' . md5($storeId . $date);
 
+        /** @var \Magento\Core\Model\Design $design */
         $design = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
             ->create('Magento\Core\Model\Design');
         $design->loadChange($storeId, $date);
diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php
index 3a2482b1846048501ef02d956120efd5df15408d..57fe2b4d918d533d690e45987916ab016433d6c4 100644
--- a/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php
+++ b/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php
@@ -202,10 +202,7 @@ class DesignTest extends \PHPUnit_Framework_TestCase
     {
         return array(
             array('::no_scope.ext'),
-            array('./file.ext'),
             array('../file.ext'),
-            array('dir/./file.ext'),
-            array('dir/../file.ext'),
         );
     }
 
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php
index 369d5b286a0865259f9885bfbd236a17d5b405c9..1b81624d3f68d642e3f5fff5e85faf6506fa173a 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php
@@ -303,7 +303,7 @@ class IndexTest extends \Magento\Backend\Utility\Controller
         * Check that error message is set
         */
         $this->assertSessionMessages(
-            $this->equalTo(array('Customer with the same email already exists.')),
+            $this->equalTo(array('Customer with the same email already exists in associated website.')),
             \Magento\Message\MessageInterface::TYPE_ERROR
         );
         $this->assertEquals($post, \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
diff --git a/dev/tests/integration/testsuite/Magento/Filesystem/Directory/ReadTest.php b/dev/tests/integration/testsuite/Magento/Filesystem/Directory/ReadTest.php
index 841c9c2d62e04a23129e005875362d095a7b98d1..d8419a2b582fcdc1568c18608d5ad2ff9b7dee33 100644
--- a/dev/tests/integration/testsuite/Magento/Filesystem/Directory/ReadTest.php
+++ b/dev/tests/integration/testsuite/Magento/Filesystem/Directory/ReadTest.php
@@ -115,8 +115,8 @@ class ReadTest extends \PHPUnit_Framework_TestCase
     public function searchProvider()
     {
         return array(
-            array('foo', '/bar/', array('bar/baz/file_one.txt', 'bar/file_two.txt')),
-            array('foo', '/\.txt/', array('bar/baz/file_one.txt', 'bar/file_two.txt', 'file_three.txt')),
+            array('foo', 'bar/*', array('bar/file_two.txt', 'bar/baz')),
+            array('foo', '/*/*.txt', array('bar/file_two.txt')),
             array('foo', '/notfound/', array())
         );
     }
diff --git a/app/code/Magento/Wishlist/Block/Render/Item/Price.php b/dev/tests/integration/testsuite/Magento/GoogleShopping/Controller/Adminhtml/GoogleShopping/TypesTest.php
similarity index 51%
rename from app/code/Magento/Wishlist/Block/Render/Item/Price.php
rename to dev/tests/integration/testsuite/Magento/GoogleShopping/Controller/Adminhtml/GoogleShopping/TypesTest.php
index 44d494bff43cf4fd25ecef7a670c1e378e93ca28..d28fc6ebc927fc0ea3ab22a33de03a9c496c39be 100644
--- a/app/code/Magento/Wishlist/Block/Render/Item/Price.php
+++ b/dev/tests/integration/testsuite/Magento/GoogleShopping/Controller/Adminhtml/GoogleShopping/TypesTest.php
@@ -19,41 +19,23 @@
  * needs please refer to http://www.magentocommerce.com for more information.
  *
  * @category    Magento
- * @package     Magento_Wishlist
+ * @package     Magento_GoogleShopping
+ * @subpackage  integration_tests
  * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
  */
 
+namespace Magento\GoogleShopping\Controller\Adminhtml\GoogleShopping;
+
 /**
- * Wishlist block for rendering price of item with product
- *
- * @category   Magento
- * @package    Magento_Wishlist
- * @author     Magento Core Team <core@magentocommerce.com>
+ * @magentoAppArea adminhtml
  */
-namespace Magento\Wishlist\Block\Render\Item;
-
-class Price extends \Magento\View\Element\Template
+class TypesTest extends \Magento\Backend\Utility\Controller
 {
-    /**
-     * Returns html for rendering non-configured product
-     */
-    public function getCleanProductPriceHtml()
+    public function testIndexAction()
     {
-        $renderer = $this->getCleanRenderer();
-        if (!$renderer) {
-            return '';
-        }
-
-        $product = $this->getProduct();
-        if ($product->canConfigure()) {
-            $product = clone $product;
-            $product->setCustomOptions(array());
-        }
-
-        return $renderer->setProduct($product)
-            ->setDisplayMinimalPrice($this->getDisplayMinimalPrice())
-            ->setIdSuffix($this->getIdSuffix())
-            ->toHtml();
+        $this->dispatch('backend/admin/googleshopping_types/index/');
+        $body = $this->getResponse()->getBody();
+        $this->assertSelectCount('[data-role="row"]', 1, $body, 'Grid with row exists');
     }
 }
diff --git a/dev/tests/integration/testsuite/Magento/Install/Model/InstallerTest.php b/dev/tests/integration/testsuite/Magento/Install/Model/InstallerTest.php
index 6b728079bc0d18690ac803613d6d3d4be5e623e8..74f1028b59cc3a3aa5dec8939717279e91b39e5e 100644
--- a/dev/tests/integration/testsuite/Magento/Install/Model/InstallerTest.php
+++ b/dev/tests/integration/testsuite/Magento/Install/Model/InstallerTest.php
@@ -192,15 +192,37 @@ class InstallerTest extends \PHPUnit_Framework_TestCase
         $configFile = \Magento\TestFramework\Helper\Bootstrap::getInstance()->getAppInstallDir() . '/etc/local.xml';
         copy($configFile, self::$_tmpConfigFile);
 
+        $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
+
+        /**
+         * @var $cache \Magento\App\Cache
+         */
+        $cache = $objectManager->create('Magento\App\Cache');
+        /**
+         * @var $appState \Magento\App\State
+         */
+        $appState = $objectManager->get('Magento\App\State');
+
+        $cache->save('testValue', 'testName');
+        $this->assertEquals('testValue', $cache->load('testName'));
+
+        //to test it works - set state to uninstalled
+        $appState->setInstallDate(null);
+        $this->assertFalse($appState->isInstalled());
+
         $this->_getModel(true)->finish();
 
+        $this->assertFalse($cache->load('testName'), 'Cache was not cleaned');
+        $this->assertTrue(
+            $appState->isInstalled(),
+            'In-memory application installation state was not changed right after finishing installation phase'
+        );
+
         /** @var $cacheState \Magento\App\Cache\StateInterface */
-        $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
-            ->create('Magento\App\Cache\StateInterface');
+        $cacheState = $objectManager->create('Magento\App\Cache\StateInterface');
 
         /** @var \Magento\App\Cache\TypeListInterface $cacheTypeList */
-        $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
-            ->create('Magento\App\Cache\TypeListInterface');
+        $cacheTypeList = $objectManager->create('Magento\App\Cache\TypeListInterface');
         $types = array_keys($cacheTypeList->getTypes());
         foreach ($types as $type) {
             $this->assertTrue(
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Quote/AddressTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Quote/AddressTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..d4a1238fd041f12352c6847cb1306df107377422
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Quote/AddressTest.php
@@ -0,0 +1,138 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @category    Magento
+ * @package     Magento_Sales
+ * @subpackage  integration_tests
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Sales\Model\Quote;
+
+/**
+ * @magentoDataFixture Magento/Customer/_files/customer.php
+ * @magentoDataFixture Magento/Customer/_files/customer_two_addresses.php
+ * @magentoDataFixture Magento/Sales/_files/quote.php
+ */
+class AddressTest extends \PHPUnit_Framework_TestCase
+{
+    /** @var \Magento\Sales\Model\Quote $quote */
+    protected $_quote;
+
+    /** @var \Magento\Customer\Model\Customer $customer */
+    protected $_customer;
+
+    /**
+     * Initialize quote and customer fixtures
+     */
+    public function setUp()
+    {
+        $this->_quote = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+            ->create('Magento\Sales\Model\Quote');
+        $this->_quote->load('test01', 'reserved_order_id');
+        $this->_quote->setIsMultiShipping('0');
+
+        /** @var \Magento\Customer\Model\Customer $customer */
+        $this->_customer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+            ->create('Magento\Customer\Model\Customer');
+        $this->_customer->load(1);
+    }
+
+    /**
+     * same_as_billing must be equal 0 if billing address is being saved
+     */
+    public function testSameAsBillingForBillingAddress()
+    {
+        $this->_quote->setCustomer($this->_customer);
+        $this->_quote->getBillingAddress()
+            ->setSameAsBilling(0)
+            ->setCustomerAddress($this->_customer->getDefaultBillingAddress())
+            ->save();
+        $this->assertEquals(0, $this->_quote->getBillingAddress()->getSameAsBilling());
+    }
+
+    /**
+     * same_as_billing must be equal 1 if customer is guest
+     */
+    public function testSameAsBillingWhenCustomerIsGuest()
+    {
+        $shippingAddress = $this->_quote->getShippingAddress();
+        $shippingAddress->setSameAsBilling(0);
+        $shippingAddress->save();
+        $this->assertEquals(1, $shippingAddress->getSameAsBilling());
+    }
+
+    /**
+     * same_as_billing must be equal 1 if quote address has no customer address
+     */
+    public function testSameAsBillingWhenQuoteAddressHasNoCustomerAddress()
+    {
+        $this->_quote->setCustomer($this->_customer);
+        $this->_quote->getShippingAddress()
+            ->setSameAsBilling(0)
+            ->setCustomerAddress(null)
+            ->save();
+        $this->assertEquals(1, $this->_quote->getShippingAddress()->getSameAsBilling());
+    }
+
+    /**
+     * same_as_billing must be equal 1 if customer registered and he has no default shipping address
+     */
+    public function testSameAsBillingWhenCustomerHasNoDefaultShippingAddress()
+    {
+        $this->_customer->setDefaultShipping(-1);
+        $this->_quote->setCustomer($this->_customer);
+        $this->_setCustomerAddressAndSave();
+        $this->assertEquals(1, $this->_quote->getShippingAddress()->getSameAsBilling());
+    }
+
+    /**
+     * same_as_billing must be equal 1 if customer has the same billing and shipping address
+     */
+    public function testSameAsBillingWhenCustomerHasBillingSameShipping()
+    {
+        $this->_quote->setCustomer($this->_customer);
+        $this->_setCustomerAddressAndSave();
+        $this->assertEquals(1, $this->_quote->getShippingAddress()->getSameAsBilling());
+    }
+
+    /**
+     * same_as_billing must be equal 0 if customer has default shipping address that differs from default billing
+     */
+    public function testSameAsBillingWhenCustomerHasDefaultShippingAddress()
+    {
+        $this->_customer->setDefaultShipping(2);
+        $this->_quote->setCustomer($this->_customer);
+        $this->_setCustomerAddressAndSave();
+        $this->assertEquals(0, $this->_quote->getShippingAddress()->getSameAsBilling());
+    }
+
+    /**
+     * Assign customer address to quote address and save quote address
+     */
+    protected function _setCustomerAddressAndSave()
+    {
+        $this->_quote->getShippingAddress()
+            ->setSameAsBilling(0)
+            ->setCustomerAddress($this->_customer->getDefaultBillingAddress())
+            ->save();
+    }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Resource/QuoteTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Resource/QuoteTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..2fed9c082844effd9b6b14efe9121cfef47dbf4f
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Resource/QuoteTest.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Sales\Model\Resource;
+
+class QuoteTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var \Magento\Sales\Model\Resource\Quote
+     */
+    protected $_resourceModel;
+
+    protected function setUp()
+    {
+        $this->_resourceModel = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+            ->create('Magento\Sales\Model\Resource\Quote');
+    }
+
+    /**
+     * @magentoDataFixture Magento/Sales/_files/order.php
+     */
+    public function testIsOrderIncrementIdUsedNumericIncrementId()
+    {
+        $this->assertTrue($this->_resourceModel->isOrderIncrementIdUsed('100000001'));
+    }
+
+    /**
+     * @magentoDataFixture Magento/Sales/_files/order_alphanumeric_id.php
+     */
+    public function testIsOrderIncrementIdUsedAlphanumericIncrementId()
+    {
+        $this->assertTrue($this->_resourceModel->isOrderIncrementIdUsed('M00000001'));
+    }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_alphanumeric_id.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_alphanumeric_id.php
new file mode 100644
index 0000000000000000000000000000000000000000..e9cbba385d8098dd8724771df4ce3490052397ef
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_alphanumeric_id.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+require __DIR__ . '/../../../Magento/Sales/_files/order.php';
+
+/** @var \Magento\Sales\Model\Order $order */
+$order = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+    ->create('Magento\Sales\Model\Order');
+
+$order->loadByIncrementId('100000001');
+$order->setIncrementId('M00000001');
+$order->save();
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php
index d6fd0d1d0955c4221b5b6d57d1bfddede7ec6fca..e397986fdbb232bd852adbddc142720464a2e7e6 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php
@@ -51,7 +51,10 @@ class DiConfigFilesTest extends \PHPUnit_Framework_TestCase
         $filesystem = $objectManager->get('Magento\Filesystem');
         $configDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::CONFIG);
         $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory');
-        self::$_primaryFiles = $fileIteratorFactory->create($configDirectory, $configDirectory->search('#di\.xml$#'));
+        self::$_primaryFiles = $fileIteratorFactory->create(
+            $configDirectory,
+            $configDirectory->search('{*/di.xml,di.xml}')
+        );
         //init module global configs
         /** @var $modulesReader \Magento\Module\Dir\Reader */
         $modulesReader = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/EavAttributesConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/EavAttributesConfigFilesTest.php
index 3dc4174285beee6daf2ec8be74b8ea9a13afaecd..c860d0065cef13f14f582f2a3c74ed9904479970 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/EavAttributesConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/EavAttributesConfigFilesTest.php
@@ -35,9 +35,12 @@ class EavAttributesConfigFilesTest extends \PHPUnit_Framework_TestCase
         $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
         /** @var $filesystem \Magento\Filesystem */
         $filesystem = $objectManager->get('Magento\Filesystem');
-        $appDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::APP);
+        $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::MODULES);
         $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory');
-        $xmlFiles = $fileIteratorFactory->create($appDirectory, $appDirectory->search('#/eav_attributes\.xml$#'));
+        $xmlFiles = $fileIteratorFactory->create(
+            $modulesDirectory,
+            $modulesDirectory->search('/*/*/etc/{*/eav_attributes.xml,eav_attributes.xml}')
+        );
 
         $validationStateMock = $this->getMock('Magento\Config\ValidationStateInterface');
         $validationStateMock->expects($this->any())->method('isValidated')
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ExportConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ExportConfigFilesTest.php
index c69b7e8c5460a6b20262acf35f180ec1b32aee86..a00d31eb25759ef71268ef8c93c099e0b954ecb9 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ExportConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ExportConfigFilesTest.php
@@ -35,9 +35,12 @@ class ExportConfigFilesTest extends \PHPUnit_Framework_TestCase
         $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
         /** @var $filesystem \Magento\Filesystem */
         $filesystem = $objectManager->get('Magento\Filesystem');
-        $appDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::APP);
+        $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::MODULES);
         $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory');
-        $xmlFiles = $fileIteratorFactory->create($appDirectory, $appDirectory->search('#/export\.xml$#'));
+        $xmlFiles = $fileIteratorFactory->create(
+            $modulesDirectory,
+            $modulesDirectory->search('/*/*/etc/{*/export.xml,export.xml}')
+        );
 
         $validationStateMock = $this->getMock('Magento\Config\ValidationStateInterface');
         $validationStateMock->expects($this->any())->method('isValidated')
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/FieldsetConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/FieldsetConfigFilesTest.php
index fd95efa31839dbe2462bef3e0504a0e28aca29d3..799ad2983e239c440d782b64e2788f84bdd30427 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/FieldsetConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/FieldsetConfigFilesTest.php
@@ -40,13 +40,13 @@ class FieldsetConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractCo
     /**
      * Returns a string that represents the path to the config file, starting in the app directory.
      *
-     * Format is regex
+     * Format is glob, so * is allowed.
      *
      * @return string
      */
-    protected function _getConfigFilePathRegex()
+    protected function _getConfigFilePathGlob()
     {
-        return '#/etc/fieldset\.xml$#';
+        return '/*/*/etc/fieldset.xml';
     }
 
     /**
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ImportConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ImportConfigFilesTest.php
index f7042a0a2eb5ba22061fbe2cd3566eb4169a0d82..9380b21b4012848f42d0505af77e7a81e1a5b74c 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ImportConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ImportConfigFilesTest.php
@@ -35,9 +35,12 @@ class ImportConfigFilesTest extends \PHPUnit_Framework_TestCase
         $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
         /** @var $filesystem \Magento\Filesystem */
         $filesystem = $objectManager->get('Magento\Filesystem');
-        $appDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::APP);
+        $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::MODULES);
         $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory');
-        $xmlFiles = $fileIteratorFactory->create($appDirectory, $appDirectory->search('#/import\.xml$#'));
+        $xmlFiles = $fileIteratorFactory->create(
+            $modulesDirectory,
+            $modulesDirectory->search('/*/*/etc/{*/import.xml,import.xml}')
+        );
 
         $validationStateMock = $this->getMock('Magento\Config\ValidationStateInterface');
         $validationStateMock->expects($this->any())->method('isValidated')
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php
index c77b6457430502b1d2aba9c69713d0b8ff47c485..0470c519e8d72e39d6e234c234fbe6e00b0784df 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/IndexerConfigFilesTest.php
@@ -35,9 +35,12 @@ class IndexerConfigFilesTest extends \PHPUnit_Framework_TestCase
         $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
         /** @var $filesystem \Magento\Filesystem */
         $filesystem = $objectManager->get('Magento\Filesystem');
-        $appDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::APP);
+        $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::MODULES);
         $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory');
-        $xmlFiles = $fileIteratorFactory->create($appDirectory, $appDirectory->search('#/indexers\.xml$#'));
+        $xmlFiles = $fileIteratorFactory->create(
+            $modulesDirectory,
+            $modulesDirectory->search('/*/*/etc/{*/indexers.xml,indexers.xml}')
+        );
 
         $validationStateMock = $this->getMock('Magento\Config\ValidationStateInterface');
         $validationStateMock->expects($this->any())->method('isValidated')
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/InstallWizardConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/InstallWizardConfigFilesTest.php
index 4b317efa2e1eb718563ca30951fba74d6f53209e..465ba3f48f51c7295d3774ce1d3293aa6c3818ba 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/InstallWizardConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/InstallWizardConfigFilesTest.php
@@ -41,13 +41,13 @@ class InstallWizardConfigFilesTest
     /**
      * Returns a string that represents the path to the config file, starting in the app directory.
      *
-     * Format is regex
+     * Format is glob, so * is allowed.
      *
      * @return string
      */
-    protected function _getConfigFilePathRegex()
+    protected function _getConfigFilePathGlob()
     {
-        return '#/etc/install_wizard\.xml$#';
+        return '/*/*/etc/install_wizard.xml';
     }
 
     /**
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/PaymentConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/PaymentConfigFilesTest.php
index bae2e239233ac5fe5a1a0d5a01078f8f215858e2..5a505308199543784e0096cf76a3c0b6bcd9c8a1 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/PaymentConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/PaymentConfigFilesTest.php
@@ -40,13 +40,13 @@ class PaymentConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractCon
     /**
      * Returns a string that represents the path to the config file, starting in the app directory.
      *
-     * Format is regex
+     * Format is glob, so * is allowed.
      *
      * @return string
      */
-    protected function _getConfigFilePathRegex()
+    protected function _getConfigFilePathGlob()
     {
-        return '#/etc/payment\.xml$#';
+        return '/*/*/etc/payment.xml';
     }
 
     /**
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductOptionsConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductOptionsConfigFilesTest.php
index 7723f24484d04e51dc4bcbd892b8ec8cadf200f9..1ab725fb1b0ec913c52af4f3426d842f53a1e4f4 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductOptionsConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductOptionsConfigFilesTest.php
@@ -36,9 +36,12 @@ class ProductOptionsConfigFilesTest extends \PHPUnit_Framework_TestCase
         $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
         /** @var $filesystem \Magento\Filesystem */
         $filesystem = $objectManager->get('Magento\Filesystem');
-        $appDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::APP);
+        $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::MODULES);
         $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory');
-        $xmlFiles = $fileIteratorFactory->create($appDirectory, $appDirectory->search('#/product_options\.xml$#'));
+        $xmlFiles = $fileIteratorFactory->create(
+            $modulesDirectory,
+            $modulesDirectory->search('/*/*/etc/{*/product_options.xml,product_options.xml}')
+        );
 
         $fileResolverMock = $this->getMock('Magento\Config\FileResolverInterface');
         $fileResolverMock->expects($this->any())->method('get')->will($this->returnValue($xmlFiles));
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductTypesConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductTypesConfigFilesTest.php
index 21799175fd705efaf7d8893b0cb077fb7e18be51..2bcd355a8f15a3c17f8355fce58eadc26676be12 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductTypesConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ProductTypesConfigFilesTest.php
@@ -35,9 +35,12 @@ class ProductTypesConfigFilesTest extends \PHPUnit_Framework_TestCase
         $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
         /** @var $filesystem \Magento\Filesystem */
         $filesystem = $objectManager->get('Magento\Filesystem');
-        $appDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::APP);
+        $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::MODULES);
         $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory');
-        $xmlFiles = $fileIteratorFactory->create($appDirectory, $appDirectory->search('#/product_types\.xml$#'));
+        $xmlFiles = $fileIteratorFactory->create(
+            $modulesDirectory,
+            $modulesDirectory->search('/*/*/etc/{*/product_types.xml,product_types.xml}')
+        );
 
         $fileResolverMock = $this->getMock('Magento\Config\FileResolverInterface');
         $fileResolverMock->expects($this->any())->method('get')->will($this->returnValue($xmlFiles));
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ResourcesConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ResourcesConfigFilesTest.php
index 06ddb67b5bcf36eb57ccb36b52708c40e5dac376..ce5c5e3cf91bdc997fdb1c22b940016446277d26 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ResourcesConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ResourcesConfigFilesTest.php
@@ -35,9 +35,12 @@ class ResourcesConfigFilesTest extends \PHPUnit_Framework_TestCase
         $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
         /** @var $filesystem \Magento\Filesystem */
         $filesystem = $objectManager->get('Magento\Filesystem');
-        $appDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::APP);
+        $modulesDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::MODULES);
         $fileIteratorFactory = $objectManager->get('Magento\Config\FileIteratorFactory');
-        $xmlFiles = $fileIteratorFactory->create($appDirectory, $appDirectory->search('#/resources\.xml$#'));
+        $xmlFiles = $fileIteratorFactory->create(
+            $modulesDirectory,
+            $modulesDirectory->search('/*/*/etc/{*/resources.xml,resources.xml}')
+        );
 
         $fileResolverMock = $this->getMock('Magento\Config\FileResolverInterface');
         $fileResolverMock->expects($this->any())->method('get')->will($this->returnValue($xmlFiles));
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php
index 13e34e3ad8e44aa1cd8353b9f45a0f85fe038f14..b06bf189bfa834c32d85cfc564eb3134c14a017e 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php
@@ -40,13 +40,13 @@ class ThemeConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConfi
     /**
      * Returns a string that represents the path to the config file, starting in the app directory.
      *
-     * Format is regex
+     * Format is glob, so * is allowed.
      *
      * @return string
      */
-    protected function _getConfigFilePathRegex()
+    protected function _getConfigFilePathGlob()
     {
-        return '#/etc/page_layouts\.xml$#';
+        return '/*/*/etc/page_layouts.xml';
     }
 
     /**
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/WidgetConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/WidgetConfigFilesTest.php
index 1123fc1aea14e16607a8a562987a6bd1f607a324..0921acd7e95cd4fe7bfc621b428a5f593a316441 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/WidgetConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/WidgetConfigFilesTest.php
@@ -40,13 +40,13 @@ class WidgetConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConf
     /**
      * Returns a string that represents the path to the config file, starting in the app directory.
      *
-     * Format is regex
+     * Format is glob, so * is allowed.
      *
      * @return string
      */
-    protected function _getConfigFilePathRegex()
+    protected function _getConfigFilePathGlob()
     {
-        return '#/etc/widget\.xml$#';
+        return '/*/*/etc/widget.xml';
     }
 
     /**
diff --git a/dev/tests/integration/testsuite/Magento/Tools/View/GeneratorTest.php b/dev/tests/integration/testsuite/Magento/Tools/View/GeneratorTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..a6ec0a6bf0ae3a8293eaf32c7fc04703751a3dd1
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Tools/View/GeneratorTest.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Tools\View;
+
+class GeneratorTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var \Magento\Shell
+     */
+    protected $shell;
+
+    /**
+     * @var \Magento\Filesystem\Driver\File
+     */
+    protected $filesystem;
+
+    /**
+     * Temporary destination directory
+     *
+     * @var string
+     */
+    protected $tmpDir;
+
+    protected function setUp()
+    {
+        $this->tmpDir = BP . '/var/static';
+        $this->shell = new \Magento\Shell();
+        $this->filesystem = new \Magento\Filesystem\Driver\File();
+        if (!$this->filesystem->isExists($this->tmpDir)) {
+            $this->filesystem->createDirectory($this->tmpDir, 0777);
+        }
+    }
+
+    protected function tearDown()
+    {
+        if ($this->filesystem->isExists($this->tmpDir)) {
+            $this->filesystem->deleteDirectory($this->tmpDir);
+        }
+    }
+
+    /**
+     * Test view generator
+     */
+    public function testViewGenerator()
+    {
+        try {
+            $this->shell->execute(
+                'php -f %s -- --source %s --destination %s',
+                array(BP . '/dev/tools/Magento/Tools/View/generator.php', BP . '/app/design', $this->tmpDir)
+            );
+        } catch (\Magento\Exception $exception) {
+            $this->fail($exception->getPrevious()->getMessage());
+        }
+    }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/ReaderTest.php
index f62cd9b088fdf927d02d87fab88ed38effd7a0e1..9285de4ddaa703a635f25821e7a6844c125864a5 100644
--- a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/ReaderTest.php
+++ b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/ReaderTest.php
@@ -45,7 +45,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
         $this->directoryList = $objectManager->get('Magento\Filesystem\DirectoryList');
         $dirPath = ltrim(str_replace($this->directoryList->getRoot(), '', str_replace('\\', '/', __DIR__))
             . '/_files', '/');
-        $this->directoryList->addDirectory(\Magento\Filesystem::MODULES, array('path' => $dirPath));
+        $this->directoryList->addDirectory(\Magento\Filesystem::MODULES, array('path' => $dirPath . '/code'));
         $this->directoryList->addDirectory(\Magento\Filesystem::CONFIG, array('path' => $dirPath));
         $this->directoryList->addDirectory(\Magento\Filesystem::ROOT, array('path' => $dirPath));
 
diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php
index fa6250f03df70327da6ac632415cf4e4ee7cbbdf..84737f9866a3226cf2e5d741d843f2807f9fa592 100644
--- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php
+++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php
@@ -845,6 +845,7 @@ return array(
         . ' and \Magento\Catalog\Block\Product\View\BaseImage classes'
     ),
     array('Magento\Wishlist\Block\Links', 'Magento\Wishlist\Block\Link'),
+    array('Magento\Wishlist\Block\Render\Item\Price'),
     array('Mage_Adminhtml_Block_Api_Tab_Userroles'),
     array('Mage_Adminhtml_Block_Api_Tab_Roleinfo'),
     array('Mage_Adminhtml_Block_Api_Tab_Rolesusers'),
diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php
index bbd7719d4c161e2e551140893979e7e223cc59e7..23140b3c70b3e8081f130cf486d60a4745fc3992 100644
--- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php
+++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php
@@ -93,6 +93,7 @@ return array(
     array('_getIdAttributes', 'Magento\ObjectManager\Config\Reader\Dom'),
     array('_getInitialXml', 'Magento\ObjectManager\Config\Reader\Dom'),
     array('_getInputHtml', 'Magento\ImportExport\Block\Adminhtml\Export\Filter'),
+    array('_getItemPriceBlock', 'Magento\Wishlist\Block\AbstractBlock'),
     array('_getLabelForStore', 'Magento\Catalog\Model\Resource\Eav\Attribute'),
     array('_getMultiSelectHtml', 'Magento\ImportExport\Block\Adminhtml\Export\Filter'),
     array('_getNumberFromToHtml', 'Magento\ImportExport\Block\Adminhtml\Export\Filter'),
@@ -145,6 +146,7 @@ return array(
     array('_needSubtractTax'),
     array('_needToAddDummy'),
     array('_needToAddDummyForShipment'),
+    array('_outTemplate', 'Magento\Backend\App\AbstractAction'),
     array('_parseDescription', 'Magento\Sales\Model\Order\Pdf\Items\AbstractItems'),
     array('_parsePackageTheme', 'Magento\Widget\Model\Widget\Instance'),
     array('_parseXmlTrackingResponse', 'Magento\Usa\Model\Shipping\Carrier\Fedex'),
@@ -191,6 +193,7 @@ return array(
     array('addCustomersToAlertQueueAction'),
     array('addCustomerToSegments'),
     array('addHandle', 'Magento\Core\Model\Layout\Update', 'Magento\Core\Model\Layout\Merge'),
+    array('addItemPriceBlockType'),
     array('addItemRender', 'Magento\Sales\Block\Adminhtml\Items\AbstractItems'),
     array('addItemRender', 'Magento\Checkout\Block\Cart\AbstractCart'),
     array('addItemRender', 'Magento\Sales\Block\Items\AbstractItems'),
@@ -450,8 +453,8 @@ return array(
     array('getParentProductIds', 'Magento\Catalog\Model\Resource\Product'),
     array('getPostMaxSize', 'Magento\Backend\Block\Media\Uploader', 'Magento_File_Size::getPostMaxSize()'),
     array('getPriceFormatted', 'Magento\Customer\Block\Adminhtml\Edit\Tab\View\Sales'),
-    array('getPrices', 'Magento\Bundle\Model\Product\Price'),
-    array('getPricesDependingOnTax', 'Magento\Bundle\Model\Product\Price'),
+    array('getPrices', 'Magento\Bundle\Model\Product\Price', 'getTotalPrices()'),
+    array('getPricesDependingOnTax', 'Magento\Bundle\Model\Product\Price', 'getTotalPrices()'),
     array('getPrintUrl', 'Magento\Checkout\Block\Onepage\Success'),
     array('getPrintUrl', 'Magento\Sales\Block\Order\Info'),
     array('getProduct', 'Magento\Catalog\Model\Product\Type\AbstractType'),
diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php
index be771b1946799d42ad9f35f0558bda6ca0e2e027..19e85986d601c5d2bd319c2b54f0bcd7662e4152 100644
--- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php
+++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php
@@ -33,6 +33,7 @@ return array(
     array('_appMode', 'Magento\App\ObjectManager\ConfigLoader'),
     array('_baseDirCache', 'Magento\Core\Model\Config'),
     array('_cacheConf'),
+    array('_cachedItemPriceBlocks'),
     array('_canUseLocalModules'),
     array('_checkedProductsQty', 'Magento\CatalogInventory\Model\Observer'),
     array('_children', 'Magento\Core\Block\AbstractBlock'),
@@ -62,6 +63,7 @@ return array(
     array('_isAnonymous'),
     array('_isFirstTimeProcessRun', 'Magento\SalesRule\Model\Validator'),
     array('_isRuntimeValidated', 'Magento\ObjectManager\Config\Reader\Dom'),
+    array('_itemPriceBlockTypes'),
     array('_loadDefault', 'Magento\Core\Model\Resource\Store\Collection'),
     array('_loadDefault', 'Magento\Core\Model\Resource\Store\Group\Collection'),
     array('_loadDefault', 'Magento\Core\Model\Resource\Website\Collection'),
diff --git a/dev/tests/unit/phpunit.xml.dist b/dev/tests/unit/phpunit.xml.dist
index 3ce287e215c9ca100865a801c38fba706e3ff0bb..d8d3cb220bea1fdba2da52828a77f1fc013fd2c8 100755
--- a/dev/tests/unit/phpunit.xml.dist
+++ b/dev/tests/unit/phpunit.xml.dist
@@ -36,6 +36,16 @@
     <listeners>
         <listener class="Magento\TestFramework\Listener\GarbageCleanup" file="framework/Magento/TestFramework/Listener/GarbageCleanup.php"/>
     </listeners>
+    <filter>
+        <whitelist addUncoveredFilesFromWhiteList="true">
+            <directory suffix=".php">../../../app/code/Magento</directory>
+            <directory suffix=".php">../../../lib/Magento</directory>
+            <exclude>
+                <directory suffix=".php">../../../app/code/Magento/*/sql</directory>
+                <directory suffix=".php">../../../app/code/Magento/*/data</directory>
+            </exclude>
+        </whitelist>
+    </filter>
     <logging>
         <!--coverage_html_placeholder
             <log type="coverage-html" target="{{coverage_dir}}/test-reports/coverage" charset="UTF-8" yui="true" highlight="true"/>
diff --git a/dev/tests/unit/testsuite/Magento/App/Response/Http/FileFactoryTest.php b/dev/tests/unit/testsuite/Magento/App/Response/Http/FileFactoryTest.php
index b6eeb1c75f94fb85272d9c12c845a81ee5f0e627..f079bda1d83b55d56c60d4feeb7d41a5d96f9542 100644
--- a/dev/tests/unit/testsuite/Magento/App/Response/Http/FileFactoryTest.php
+++ b/dev/tests/unit/testsuite/Magento/App/Response/Http/FileFactoryTest.php
@@ -40,16 +40,28 @@ class FileFactoryTest extends \PHPUnit_Framework_TestCase
      */
     protected $_responseMock;
 
+    /**
+     * @var \Magento\Filesystem\Directory\WriteInterface
+     */
+    protected $_dirMock;
+
     protected function setUp()
     {
         $this->_fileSystemMock = $this->getMock(
-            'Magento\Filesystem', array('getFileSize', 'isFile'), array(), '', false
+            'Magento\Filesystem', array('getDirectoryWrite'), array(), '', false
         );
-        $this->_fileSystemMock->expects($this->any())->method('getFileSize')
-            ->withAnyParameters()->will($this->returnValue(0));
+        $this->_dirMock = $this->getMockBuilder('\Magento\Filesystem\Directory\Write')
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $this->_fileSystemMock->expects($this->any())->method('getDirectoryWrite')
+            ->withAnyParameters()->will($this->returnValue($this->_dirMock));
+
+
         $this->_fileSystemMock->expects($this->any())->method('isFile')
             ->withAnyParameters()->will($this->returnValue(0));
-        $this->_responseMock = $this->getMock('Magento\App\Response\Http', array('setHeader'), array(), '', false);
+        $this->_responseMock =
+            $this->getMock('Magento\App\Response\Http', array('setHeader', 'sendHeaders'), array(), '', false);
         $this->_responseMock->expects($this->any())->method('setHeader')
             ->will($this->returnValue($this->_responseMock));
         $this->_model = new \Magento\App\Response\Http\FileFactory(
@@ -77,9 +89,7 @@ class FileFactoryTest extends \PHPUnit_Framework_TestCase
             'type' => 'filename',
             'value' => $file
         );
-        $this->_fileSystemMock->expects($this->any())
-            ->method('stat')
-            ->will($this->returnValue(array('size' => 'string')));
+
         $this->_model->create('fileName', $content);
     }
 }
diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/OptionTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/OptionTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..20eefb8b7777ae9ad11d956378b028b6e3855f5c
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/OptionTest.php
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Bundle\Block\Catalog\Product\View\Type\Bundle;
+
+class OptionTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option
+     */
+    protected $_block;
+
+    protected function setUp()
+    {
+        $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this);
+
+        $this->_block =
+            $objectManagerHelper->getObject('\Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option');
+
+        $product = $this->getMock(
+            '\Magento\Catalog\Model\Product', array('hasPreconfiguredValues', 'getPreconfiguredValues', '__wakeup'),
+            array(), '', false
+        );
+        $product->expects($this->atLeastOnce())->method('hasPreconfiguredValues')->will($this->returnValue(true));
+        $product->expects($this->atLeastOnce())
+            ->method('getPreconfiguredValues')
+            ->will($this->returnValue(new \Magento\Object(array('bundle_option' => array(15 => 315, 16 => 316)))));
+
+        $this->_block->setData('product', $product);
+    }
+
+    public function testSetOption()
+    {
+        $option = $this->getMock('\Magento\Bundle\Model\Option', array(), array(), '', false);
+        $option->expects($this->any())->method('getId')->will($this->returnValue(15));
+
+        $otherOption = $this->getMock('\Magento\Bundle\Model\Option', array(), array(), '', false);
+        $otherOption->expects($this->any())->method('getId')->will($this->returnValue(16));
+
+        $selection = $this->getMock(
+            '\Magento\Catalog\Model\Product', array('getSelectionId', '__wakeup'), array(), '', false
+        );
+        $selection->expects($this->atLeastOnce())->method('getSelectionId')->will($this->returnValue(315));
+
+        $this->assertSame($this->_block, $this->_block->setOption($option));
+        $this->assertTrue($this->_block->isSelected($selection));
+
+        $this->_block->setOption($otherOption);
+        $this->assertFalse(
+            $this->_block->isSelected($selection),
+            'Selected value should change after new option is set'
+        );
+    }
+}
diff --git a/dev/tests/unit/testsuite/Magento/Captcha/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Captcha/Model/ObserverTest.php
index 6b8fbfc86fcbbf03fbdd466a5ba62965e49a95d5..e0c75115507a6987553a306e76051b2e0a8ee3a5 100644
--- a/dev/tests/unit/testsuite/Magento/Captcha/Model/ObserverTest.php
+++ b/dev/tests/unit/testsuite/Magento/Captcha/Model/ObserverTest.php
@@ -93,6 +93,11 @@ class ObserverTest extends \PHPUnit_Framework_TestCase
      */
     protected $_messageManager;
 
+    /**
+     * @var \PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $redirect;
+
     protected function setUp()
     {
         $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
@@ -110,6 +115,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase
         $this->_urlManager = $this->getMock('Magento\Core\Model\Url', array(), array(), '', false);
         $this->_actionFlag = $this->getMock('Magento\App\ActionFlag', array(), array(), '', false);
         $this->_messageManager = $this->getMock('\Magento\Message\ManagerInterface', array(), array(), '', false);
+        $this->redirect = $this->getMock('\Magento\App\Response\RedirectInterface', array(), array(), '', false);
         $this->_observer = $this->_objectManager->getObject(
             'Magento\Captcha\Model\Observer',
             array(
@@ -121,7 +127,8 @@ class ObserverTest extends \PHPUnit_Framework_TestCase
                 'helper' => $this->_helper,
                 'urlManager' => $this->_urlManager,
                 'actionFlag' => $this->_actionFlag,
-                'messageManager' => $this->_messageManager
+                'messageManager' => $this->_messageManager,
+                'redirect' => $this->redirect,
             )
         );
 
@@ -166,22 +173,21 @@ class ObserverTest extends \PHPUnit_Framework_TestCase
         $redirectRoutePath = 'contacts/index/index';
         $redirectUrl = 'http://magento.com/contacts/';
 
-        $this->_urlManager->expects($this->once())
-            ->method('getUrl')
-            ->with($redirectRoutePath, null)
-            ->will($this->returnValue($redirectUrl));
-
-        $controller = $this->getMock('Magento\App\Action\Action', array(), array(), '', false);
         $request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false);
         $response = $this->getMock('Magento\App\Response\Http', array(), array(), '', false);
-        $request->expects($this->any())->method('getPost')->with(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE,
-            null)
+        $request->expects($this->any())
+            ->method('getPost')
+            ->with(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE, null)
             ->will($this->returnValue(array(
                 $formId => $captchaValue,
             )));
-        $response->expects($this->once())
-            ->method('setRedirect')
-            ->with($redirectUrl, 302);
+
+        $this->redirect->expects($this->once())
+            ->method('redirect')
+            ->with($response, $redirectRoutePath, array())
+            ->will($this->returnValue($redirectUrl));
+
+        $controller = $this->getMock('Magento\App\Action\Action', array(), array(), '', false);
         $controller->expects($this->any())->method('getRequest')->will($this->returnValue($request));
         $controller->expects($this->any())->method('getResponse')->will($this->returnValue($response));
         $this->_captcha->expects($this->any())->method('isRequired')->will($this->returnValue(true));
@@ -210,6 +216,95 @@ class ObserverTest extends \PHPUnit_Framework_TestCase
         $this->_observer->checkContactUsForm(new \Magento\Event\Observer());
     }
 
+    public function testCheckForgotpasswordRedirects()
+    {
+        $formId = 'user_forgotpassword';
+        $captchaValue = 'some-value';
+        $warningMessage = 'Incorrect CAPTCHA';
+        $redirectRoutePath = '*/*/forgotpassword';
+        $redirectUrl = 'http://magento.com/customer/account/forgotpassword/';
+
+        $request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false);
+        $response = $this->getMock('Magento\App\Response\Http', array(), array(), '', false);
+        $request->expects($this->any())
+            ->method('getPost')
+            ->with(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE, null)
+            ->will($this->returnValue(array(
+                $formId => $captchaValue,
+            )));
+
+        $this->redirect->expects($this->once())
+            ->method('redirect')
+            ->with($response, $redirectRoutePath, array())
+            ->will($this->returnValue($redirectUrl));
+
+        $controller = $this->getMock('Magento\App\Action\Action', array(), array(), '', false);
+        $controller->expects($this->any())->method('getRequest')->will($this->returnValue($request));
+        $controller->expects($this->any())->method('getResponse')->will($this->returnValue($response));
+        $this->_captcha->expects($this->any())->method('isRequired')->will($this->returnValue(true));
+        $this->_captcha->expects($this->once())
+            ->method('isCorrect')
+            ->with($captchaValue)
+            ->will($this->returnValue(false));
+        $this->_helper->expects($this->any())->method('getCaptcha')
+            ->with($formId)
+            ->will($this->returnValue($this->_captcha));
+        $this->_messageManager->expects($this->once())->method('addError')->with($warningMessage);
+        $this->_actionFlag->expects($this->once())->method('set')
+            ->with('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true);
+
+        $this->_observer->checkForgotpassword(new \Magento\Event\Observer(array('controller_action' => $controller)));
+    }
+
+    public function testCheckUserCreateRedirectsError()
+    {
+        $formId = 'user_create';
+        $captchaValue = 'some-value';
+        $warningMessage = 'Incorrect CAPTCHA';
+        $redirectRoutePath = '*/*/create';
+        $redirectUrl = 'http://magento.com/customer/account/create/';
+
+        $request = $this->getMock('Magento\App\Request\Http', array(), array(), '', false);
+        $request->expects($this->at(0))
+            ->method('getPost')
+            ->with(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE, null)
+            ->will($this->returnValue(array(
+                $formId => $captchaValue,
+            )));
+
+        $response = $this->getMock('Magento\App\Response\Http', array(), array(), '', false);
+        $response->expects($this->once())
+            ->method('setRedirect')
+            ->with($redirectUrl);
+
+        $this->_urlManager->expects($this->once())
+            ->method('getUrl')
+            ->with($redirectRoutePath, array('_nosecret' => true))
+            ->will($this->returnValue($redirectUrl));
+
+        $this->redirect->expects($this->once())
+            ->method('error')
+            ->with($redirectUrl)
+            ->will($this->returnValue($redirectUrl));
+
+        $controller = $this->getMock('Magento\App\Action\Action', array(), array(), '', false);
+        $controller->expects($this->any())->method('getRequest')->will($this->returnValue($request));
+        $controller->expects($this->any())->method('getResponse')->will($this->returnValue($response));
+        $this->_captcha->expects($this->any())->method('isRequired')->will($this->returnValue(true));
+        $this->_captcha->expects($this->once())
+            ->method('isCorrect')
+            ->with($captchaValue)
+            ->will($this->returnValue(false));
+        $this->_helper->expects($this->any())->method('getCaptcha')
+            ->with($formId)
+            ->will($this->returnValue($this->_captcha));
+        $this->_messageManager->expects($this->once())->method('addError')->with($warningMessage);
+        $this->_actionFlag->expects($this->once())->method('set')
+            ->with('', \Magento\App\Action\Action::FLAG_NO_DISPATCH, true);
+
+        $this->_observer->checkUserCreate(new \Magento\Event\Observer(array('controller_action' => $controller)));
+    }
+
     /**
      * Get stub for resource model
      * @return \Magento\Captcha\Model\Resource\Log
diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/UrlTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/UrlTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..93b16e6250a22d52e05c7887392d9fce1f4ee4a6
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/UrlTest.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+namespace Magento\Catalog\Model;
+
+class UrlTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var \Magento\Catalog\Model\Url
+     */
+    protected $_model;
+
+    /**
+     * @var \Magento\TestFramework\Helper\ObjectManager
+     */
+    protected $_objectManager;
+
+    protected function setUp()
+    {
+        $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
+        $this->_model = $this->_objectManager->getObject('Magento\Catalog\Model\Url');
+    }
+
+    public function testGenerateUniqueIdPath()
+    {
+        $path = $this->_model->generateUniqueIdPath();
+        $this->assertNotContains('.', $path);
+        $this->assertContains('_', $path);
+        $this->assertNotEquals($path, $this->_model->generateUniqueIdPath());
+    }
+}
diff --git a/dev/tests/unit/testsuite/Magento/Centinel/Model/ServiceTest.php b/dev/tests/unit/testsuite/Magento/Centinel/Model/ServiceTest.php
index 218a78ad7f67e7c14d69495a91f4814b678ef927..ae5501205f5f0b31ba48403d1b198336c8a8f2fe 100644
--- a/dev/tests/unit/testsuite/Magento/Centinel/Model/ServiceTest.php
+++ b/dev/tests/unit/testsuite/Magento/Centinel/Model/ServiceTest.php
@@ -35,18 +35,100 @@ class ServiceTest extends \PHPUnit_Framework_TestCase
      */
     public function testGetAuthenticationStartUrl()
     {
-        $url = $this->getMock('Magento\Core\Model\Url', array('getUrl'), array(), '', false);
+        $url = $this->getMock('Magento\Core\Model\Url', ['getUrl'], [], '', false);
         $url->expects($this->once())
             ->method('getUrl')
             ->with($this->equalTo('url_prefix/authenticationstart'))
             ->will($this->returnValue('some value'));
 
         $helper = new \Magento\TestFramework\Helper\ObjectManager($this);
-        /** @var Service $model */
+        /** @var \Magento\Centinel\Model\Service $model */
         $model = $helper->getObject(
             'Magento\Centinel\Model\Service',
-            array('url' => $url, 'urlPrefix' => 'url_prefix/')
+            ['url' => $url, 'urlPrefix' => 'url_prefix/']
         );
         $this->assertEquals('some value', $model->getAuthenticationStartUrl());
     }
+
+    public function testLookup()
+    {
+        $centinelSession = $this->getMock('Magento\Session\SessionManager', ['setData', 'getData'], [], '', false);
+        $centinelSession->expects($this->once())
+            ->method('setData')
+            ->with([]);
+        $centinelSession->expects($this->once())
+            ->method('getData')
+            ->will($this->returnValue('cardType'));
+
+        $api = $this->getMock(
+            'Magento\Centinel\Model\Api',
+            ['setProcessorId', 'setMerchantId', 'setTransactionPwd', 'setIsTestMode', 'setDebugFlag', 'callLookup'],
+            [],
+            '',
+            false
+        );
+        $api->expects($this->once())->method('setProcessorId')->will($this->returnValue($api));
+        $api->expects($this->once())->method('setMerchantId')->will($this->returnValue($api));
+        $api->expects($this->once())->method('setTransactionPwd')->will($this->returnValue($api));
+        $api->expects($this->once())->method('setIsTestMode')->will($this->returnValue($api));
+        $api->expects($this->once())->method('setDebugFlag')->will($this->returnValue($api));
+        $api->expects($this->once())->method('callLookup')->will($this->returnValue('result'));
+        $apiFactory = $this->getMock('Magento\Centinel\Model\ApiFactory', ['create'], [], '', false);
+        $apiFactory->expects($this->once())
+            ->method('create')
+            ->will($this->returnValue($api));
+
+        $state = $this->getMock(
+            '\Magento\Centinel\Model\State',
+            ['setDataStorage', 'setCardType', 'setChecksum', 'setIsModeStrict', 'setLookupResult'],
+            [],
+            '',
+            false
+        );
+        $state->expects($this->any())
+            ->method('setDataStorage')
+            ->with($centinelSession)
+            ->will($this->returnValue($state));
+        $state->expects($this->once())
+            ->method('setCardType')
+            ->with('cardType')
+            ->will($this->returnValue($state));
+        $state->expects($this->once())
+            ->method('setChecksum')
+            ->will($this->returnValue($state));
+        $state->expects($this->once())
+            ->method('setLookupResult')
+            ->with('result');
+        $stateFactory = $this->getMock(
+            '\Magento\Centinel\Model\StateFactory', ['createState'], [], '', false);
+        $stateFactory->expects($this->any())
+            ->method('createState')
+            ->with('cardType')
+            ->will($this->returnValue($state));
+
+        $config = $this->getMock(
+            '\Magento\Centinel\Model\Config',
+            ['setStore', 'getProcessorId', 'getMerchantId', 'getTransactionPwd', 'getIsTestMode', 'getDebugFlag'],
+            [],
+            '',
+            false
+        );
+        $config->expects($this->once())->method('setStore')->will($this->returnValue($config));
+
+        $helper = new \Magento\TestFramework\Helper\ObjectManager($this);
+        /** @var \Magento\Centinel\Model\Service $model */
+        $model = $helper->getObject(
+            'Magento\Centinel\Model\Service',
+            [
+                'apiFactory' => $apiFactory,
+                'centinelSession' => $centinelSession,
+                'stateFactory' => $stateFactory,
+                'config' => $config
+            ]
+        );
+
+        $data = new \Magento\Object(['card_type' => 'cardType']);
+
+        $model->lookup($data);
+    }
 }
diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/Onepage/PaymentTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/Onepage/PaymentTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..0aaaa51b625dac408be2dc2535e5418041953582
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/Onepage/PaymentTest.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+namespace Magento\Checkout\Block\Onepage;
+
+class PaymentTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @param mixed $hasRecurringItems
+     * @dataProvider hasRecurringItemsDataProvider
+     */
+    public function testHasRecurringItems($hasRecurringItems)
+    {
+        $helper = new \Magento\TestFramework\Helper\ObjectManager($this);
+        $quote = $this->getMock('Magento\Sales\Model\Quote', array(
+            'hasRecurringItems',
+            '__wakeup'
+        ), array(), '', false);
+        $quote->expects($this->once())->method('hasRecurringItems')->will($this->returnValue($hasRecurringItems));
+        $checkoutSession = $this->getMock('Magento\Checkout\Model\Session', array(
+            'getQuote',
+            'setStepData'
+        ), array(), '', false);
+        $checkoutSession->expects($this->once())->method('getQuote')->will($this->returnValue($quote));
+        /** @var \Magento\Checkout\Block\Onepage\Payment $model */
+        $model = $helper->getObject('Magento\Checkout\Block\Onepage\Payment', array(
+            'resourceSession' => $checkoutSession
+        ));
+        $this->assertEquals($hasRecurringItems, $model->hasRecurringItems());
+    }
+
+    public function hasRecurringItemsDataProvider()
+    {
+        return array(
+            array(false),
+            array(true),
+        );
+    }
+}
diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Helper/DataTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..d307d715595179cfd552f9cf472cbd2b5ee47958
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Checkout/Helper/DataTest.php
@@ -0,0 +1,142 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+namespace Magento\Checkout\Helper;
+
+class DataTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var Data
+     */
+    private $_helper;
+
+    /**
+     * @var \PHPUnit_Framework_MockObject_MockObject
+     */
+    private $_emailTemplate;
+
+    /**
+     * @var \PHPUnit_Framework_MockObject_MockObject
+     */
+    private $_translator;
+
+    protected function setUp()
+    {
+        $this->_translator = $this->getMock('Magento\Core\Model\Translate', array(), array(), '', false);
+        $context = $this->getMock('\Magento\App\Helper\Context', array(), array(), '', false);
+        $context->expects($this->any())->method('getTranslator')->will($this->returnValue($this->_translator));
+
+        $storeConfig = $this->getMock('\Magento\Core\Model\Store\Config', array(), array(), '', false);
+        $storeConfig->expects($this->any())->method('getConfig')->will($this->returnValueMap(array(
+            array('checkout/payment_failed/template',       8, 'fixture_email_template_payment_failed'),
+            array('checkout/payment_failed/receiver',       8, 'sysadmin'),
+            array('trans_email/ident_sysadmin/email',       8, 'sysadmin@example.com'),
+            array('trans_email/ident_sysadmin/name',        8, 'System Administrator'),
+            array('checkout/payment_failed/identity',       8, 'noreply@example.com'),
+            array('carriers/ground/title',                  null, 'Ground Shipping'),
+            array('payment/fixture-payment-method/title',   null, 'Check Money Order'),
+        )));
+
+        $storeManager = $this->getMock('\Magento\Core\Model\StoreManagerInterface', array(), array(), '', false);
+
+        $checkoutSession = $this->getMock('\Magento\Checkout\Model\Session', array(), array(), '', false);
+
+        $locale = $this->getMock('\Magento\Core\Model\LocaleInterface', array(), array(), '', false);
+        $locale->expects($this->any())->method('date')->will($this->returnValue('Oct 02, 2013'));
+
+        $collectionFactory = $this->getMock(
+            '\Magento\Checkout\Model\Resource\Agreement\CollectionFactory', array(), array(), '', false
+        );
+
+        $this->_emailTemplate = $this->getMock('\Magento\Email\Model\Template', array(), array(), '', false);
+        $emailTplFactory = $this->getMock(
+            '\Magento\Email\Model\TemplateFactory', array('create'), array(), '', false
+        );
+        $emailTplFactory->expects($this->once())->method('create')->will($this->returnValue($this->_emailTemplate));
+
+        $this->_helper = new Data(
+            $context, $storeConfig, $storeManager, $checkoutSession,
+            $locale, $collectionFactory, $emailTplFactory
+        );
+    }
+
+    public function testSendPaymentFailedEmail()
+    {
+        $shippingAddress = new \Magento\Object(array('shipping_method' => 'ground_transportation'));
+        $billingAddress = new \Magento\Object(array('street' => 'Fixture St'));
+
+        $this->_emailTemplate
+            ->expects($this->once())
+            ->method('setDesignConfig')
+            ->with(array('area' => \Magento\Core\Model\App\Area::AREA_FRONTEND, 'store' => 8))
+            ->will($this->returnSelf())
+        ;
+        $this->_emailTemplate->expects($this->once())->method('sendTransactional')->with(
+            'fixture_email_template_payment_failed',
+            'noreply@example.com',
+            'sysadmin@example.com',
+            'System Administrator',
+            $this->identicalTo(array(
+                'reason'            => 'test message',
+                'checkoutType'      => 'onepage',
+                'dateAndTime'       => 'Oct 02, 2013',
+                'customer'          => 'John Doe',
+                'customerEmail'     => 'john.doe@example.com',
+                'billingAddress'    => $billingAddress,
+                'shippingAddress'   => $shippingAddress,
+                'shippingMethod'    => 'Ground Shipping',
+                'paymentMethod'     => 'Check Money Order',
+                'items'             => "Product One  x 2  USD 10<br />\nProduct Two  x 3  USD 60<br />\n",
+                'total'             => 'USD 70',
+            ))
+        );
+
+        $this->_translator->expects($this->at(0))->method('setTranslateInline')->with(false);
+        $this->_translator->expects($this->at(1))->method('setTranslateInline')->with(true);
+
+        $productOne = $this->getMock('\Magento\Catalog\Model\Product', array(), array(), '', false);
+        $productOne->expects($this->once())->method('getName')->will($this->returnValue('Product One'));
+        $productOne->expects($this->once())->method('getFinalPrice')->with(2)->will($this->returnValue(10));
+
+        $productTwo = $this->getMock('\Magento\Catalog\Model\Product', array(), array(), '', false);
+        $productTwo->expects($this->once())->method('getName')->will($this->returnValue('Product Two'));
+        $productTwo->expects($this->once())->method('getFinalPrice')->with(3)->will($this->returnValue(60));
+
+        $quote = new \Magento\Object(array(
+            'store_id'              => 8,
+            'store_currency_code'   => 'USD',
+            'grand_total'           => 70,
+            'customer_firstname'    => 'John',
+            'customer_lastname'     => 'Doe',
+            'customer_email'        => 'john.doe@example.com',
+            'billing_address'       => $billingAddress,
+            'shipping_address'      => $shippingAddress,
+            'payment'               => new \Magento\Object(array('method' => 'fixture-payment-method')),
+            'all_visible_items'     => array(
+                new \Magento\Object(array('product' => $productOne, 'qty' => 2)),
+                new \Magento\Object(array('product' => $productTwo, 'qty' => 3)),
+            ),
+        ));
+        $this->assertSame($this->_helper, $this->_helper->sendPaymentFailedEmail($quote, 'test message'));
+    }
+}
diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Config/FileResolverTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Config/FileResolverTest.php
index 476b5660f2f0b2fe390b729880d5ffaa30e3d7cf..7a0c4a9cf8aea335b740714b914f42e87d5e4c7d 100644
--- a/dev/tests/unit/testsuite/Magento/Core/Model/Config/FileResolverTest.php
+++ b/dev/tests/unit/testsuite/Magento/Core/Model/Config/FileResolverTest.php
@@ -95,7 +95,7 @@ class FileResolverTest extends \PHPUnit_Framework_TestCase
         );
         $directory->expects($this->once())
             ->method('search')
-            ->with('#' . preg_quote($filename) . '$#')
+            ->with(sprintf('{%1$s,*/%1$s}', $filename))
             ->will($this->returnValue($fileList));
         $this->filesystem->expects($this->once())
             ->method('getDirectoryRead')
diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/File/Storage/FileTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/File/Storage/FileTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..8d4867f6031d2750d4ab0ede2c040038ae588f88
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/File/Storage/FileTest.php
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+namespace Magento\Core\Model\Resource\File\Storage;
+
+/**
+ * Class FileTest
+ */
+class FileTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var \Magento\Core\Model\File\Storage\File
+     */
+    protected $_model;
+
+    /**
+     * @var \Magento\Core\Helper\File\Media
+     */
+    protected $_loggerMock;
+
+    /**
+     * @var \Magento\Filesystem
+     */
+    protected $_filesystemMock;
+
+    /**
+     * @var \Magento\Filesystem\Directory\Read
+     */
+    protected $_directoryReadMock;
+
+    protected function setUp()
+    {
+        $this->_loggerMock = $this->getMock('Magento\Logger', array(), array(), '', false);
+        $this->_filesystemMock = $this->getMock('Magento\Filesystem', array('getDirectoryRead'), array(), '', false);
+        $this->_directoryReadMock =
+            $this->getMock('Magento\Filesystem\Directory\Read', array('isDirectory', 'read'), array(), '', false);
+        $this->_directoryReadMock
+            ->expects($this->any())
+            ->method('isDirectory')
+            ->will($this->returnValue(true));
+        $this->_directoryReadMock
+            ->expects($this->any())
+            ->method('read')
+            ->with('pub')
+            ->will($this->returnValue(array(
+                'media/customer',
+                'media/downloadable',
+                'media/theme',
+                'media/theme_customization',
+                'media')
+            ));
+        $this->_filesystemMock
+            ->expects($this->any())
+            ->method('getDirectoryRead')
+            ->with('media')
+            ->will($this->returnValue($this->_directoryReadMock));
+        $this->_model = new \Magento\Core\Model\Resource\File\Storage\File(
+            $this->_filesystemMock,
+            $this->_loggerMock
+        );
+    }
+
+    public function testGetStorageData()
+    {
+        $directories = array(
+            array('name' => 'customer', 'path' => 'media'),
+            array('name' => 'downloadable', 'path' => 'media'),
+            array('name' => 'theme', 'path' => 'media'),
+            array('name' => 'theme_customization', 'path' => 'media'),
+            array('name' => 'media', 'path' => '/'),
+        );
+        $expected = array('files' => array(), 'directories' => $directories);
+        $actual = $this->_model->getStorageData('pub');
+        $this->assertEquals($expected, $actual);
+    }
+}
diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ValidationTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ValidationTest.php
index f8b1b0e504664723faaa6236f785e72276926156..87bb746eb9915af99938aa3a37af77948f01b545 100644
--- a/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ValidationTest.php
+++ b/dev/tests/unit/testsuite/Magento/Core/Model/Theme/ValidationTest.php
@@ -91,7 +91,7 @@ class ValidationTest extends \PHPUnit_Framework_TestCase
             array(
                 'name' => 'available', 'class' => 'Zend_Validate_Regex', 'break' => true,
                 'options' => array('pattern' => '/(\d+\.\d+\.\d+\.\d+(\-[a-zA-Z0-9]+)?)|\*/'),
-                'message' => 'Theme version has not compatible format'
+                'message' => 'Theme version has not compatible format.'
             )
         );
 
@@ -144,7 +144,7 @@ class ValidationTest extends \PHPUnit_Framework_TestCase
     {
         return array(
             'theme_code'           => array('Theme code has not compatible format'),
-            'theme_version'        => array('Theme version has not compatible format')
+            'theme_version'        => array('Theme version has not compatible format.')
         );
     }
 }
diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/WebsiteTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/WebsiteTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..825dd911b89a5dc62a9b4e87db64b39614580c9e
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Core/Model/WebsiteTest.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Core\Model;
+
+class WebsiteTest extends \PHPUnit_Framework_TestCase
+{
+    public function testIsCanDelete()
+    {
+        $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
+
+        $websiteCollection = $this->getMock(
+            'Magento\Core\Model\Resource\Website\Collection', array('getSize'), array(), '', false
+        );
+        $websiteCollection->expects($this->any())
+            ->method('getSize')
+            ->will($this->returnValue(2));
+
+        $websiteFactory = $this->getMock(
+            'Magento\Core\Model\WebsiteFactory', array('create', 'getCollection', '__wakeup'), array(), '', false
+        );
+        $websiteFactory->expects($this->any())
+            ->method('create')
+            ->will($this->returnValue($websiteFactory));
+        $websiteFactory->expects($this->any())
+            ->method('getCollection')
+            ->will($this->returnValue($websiteCollection));
+
+        /** @var \Magento\Core\Model\Website $websiteModel */
+        $websiteModel = $objectManager->getObject(
+            'Magento\Core\Model\Website', array('websiteFactory' => $websiteFactory)
+        );
+        $websiteModel->setId(2);
+        $this->assertTrue($websiteModel->isCanDelete());
+    }
+}
\ No newline at end of file
diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Account/CustomerTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/CustomerTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..d1d2addedc8d925d4daf7cf58a8ac181cff77ea4
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/CustomerTest.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Customer\Block\Account;
+
+class CustomerTest extends \PHPUnit_Framework_TestCase
+{
+    public function testGetCustomerName()
+    {
+        $customer = $this->getMock('Magento\Customer\Model\Customer', array(), array(), '', false);
+        $customer->expects($this->once())->method('getName')->will($this->returnValue('John Doe'));
+
+        $escapedName = new \stdClass();
+        $escaper = $this->getMock('Magento\Escaper', array(), array(), '', false);
+        $escaper
+            ->expects($this->once())->method('escapeHtml')->with('John Doe')->will($this->returnValue($escapedName));
+
+        $context = $this->getMock('Magento\View\Element\Template\Context', array(), array(), '', false);
+        $context->expects($this->once())->method('getEscaper')->will($this->returnValue($escaper));
+
+        $session = $this->getMock('Magento\Customer\Model\Session', array(), array(), '', false);
+        $session->expects($this->once())->method('getCustomer')->will($this->returnValue($customer));
+
+        $block = new \Magento\Customer\Block\Account\Customer($context, $session);
+
+        $this->assertSame($escapedName, $block->getCustomerName());
+    }
+}
diff --git a/dev/tests/unit/testsuite/Magento/Customer/Controller/AccountTest.php b/dev/tests/unit/testsuite/Magento/Customer/Controller/AccountTest.php
index fc5a04597ade7b6bfe983e62f428d36b6dfbc7bb..7d6125cc7e4e533dc61dac10e3e5bf412855e3f3 100644
--- a/dev/tests/unit/testsuite/Magento/Customer/Controller/AccountTest.php
+++ b/dev/tests/unit/testsuite/Magento/Customer/Controller/AccountTest.php
@@ -32,12 +32,42 @@ namespace Magento\Customer\Controller;
 
 class AccountTest extends \PHPUnit_Framework_TestCase
 {
+    /**
+     * @var \Magento\Customer\Controller\Account
+     */
+    protected $object;
+
+    /**
+     * @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $request;
+
+    /**
+     * @var \Magento\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $response;
+
+    /**
+     * @var \Magento\Customer\Model\Session|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $customerSession;
+
+    /**
+     * @var \Magento\UrlInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $url;
+
+    /**
+     * @var \Magento\ObjectManager|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $objectManager;
+
     /**
      * List of actions that are allowed for not authorized users
      *
      * @var array
      */
-    protected $_openActions = array(
+    protected $openActions = array(
         'create',
         'login',
         'logoutsuccess',
@@ -52,31 +82,49 @@ class AccountTest extends \PHPUnit_Framework_TestCase
         'loginpost'
     );
 
-    /**
-     * @var \Magento\Customer\Controller\Account
-     */
-    protected $_model;
-
     /**
      * @var \PHPUnit_Framework_MockObject_MockObject
      */
-    protected $_objectManagerMock;
+    protected $_formKeyValidator;
 
     protected function setUp()
     {
-        $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this);
-
-        $arguments = array(
-            'urlFactory' => $this->getMock('Magento\Core\Model\UrlFactory', array(), array(), '', false),
-            'customerFactory' => $this->getMock('Magento\Customer\Model\CustomerFactory', array(), array(), '', false),
-            'formFactory' => $this->getMock('Magento\Customer\Model\FormFactory', array(), array(), '', false),
-            'addressFactory' => $this->getMock('Magento\Customer\Model\AddressFactory', array(), array(), '', false),
+        $this->request = $this->getMock(
+            'Magento\App\RequestInterface',
+            ['isPost', 'getModuleName', 'setModuleName', 'getActionName', 'setActionName', 'getParam'],
+            [],
+            '',
+            false
         );
-        $constructArguments = $objectManagerHelper->getConstructArguments(
-            'Magento\Customer\Controller\Account',
-            $arguments
+        $this->response = $this->getMock(
+            'Magento\App\ResponseInterface',
+            ['setRedirect', 'sendResponse'],
+            [],
+            '',
+            false
         );
-        $this->_model = $objectManagerHelper->getObject('Magento\Customer\Controller\Account', $constructArguments);
+        $this->customerSession = $this->getMock(
+            '\Magento\Customer\Model\Session',
+            ['isLoggedIn', 'getLastCustomerId', 'getBeforeAuthUrl', 'setBeforeAuthUrl'],
+            [],
+            '',
+            false
+        );
+        $this->url = $this->getMockForAbstractClass('\Magento\UrlInterface');
+        $this->objectManager = $this->getMock('\Magento\ObjectManager\ObjectManager', ['get'], [], '', false);
+        $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
+        $this->_formKeyValidator = $this->getMock(
+            'Magento\Core\App\Action\FormKeyValidator', array(), array(), '', false
+        );
+        $this->object = $objectManager->getObject('Magento\Customer\Controller\Account', [
+            'request' => $this->request,
+            'response' => $this->response,
+            'customerSession' => $this->customerSession,
+            'url' => $this->url,
+            'objectManager' => $this->objectManager,
+            'formKeyValidator' => $this->_formKeyValidator,
+            ''
+        ]);
     }
 
     /**
@@ -84,10 +132,32 @@ class AccountTest extends \PHPUnit_Framework_TestCase
      */
     public function testGetAllowedActions()
     {
-        $this->assertAttributeEquals($this->_openActions, '_openActions', $this->_model);
-
+        $this->assertAttributeEquals($this->openActions, '_openActions', $this->object);
+        /**
+         * @TODO: [TD] Protected methods must be tested via public. Eliminate _getAllowedActions method and write test
+         *   for dispatch method using this property instead.
+         */
         $method = new \ReflectionMethod('Magento\Customer\Controller\Account', '_getAllowedActions');
         $method->setAccessible(true);
-        $this->assertEquals($this->_openActions, $method->invoke($this->_model));
+        $this->assertEquals($this->openActions, $method->invoke($this->object));
+    }
+
+    public function testLoginPostActionWhenRefererSetBeforeAuthUrl()
+    {
+        $this->_formKeyValidator->expects($this->once())->method('validate')->will($this->returnValue(true));
+        $this->objectManager->expects($this->any())->method('get')
+            ->will($this->returnValueMap([
+                ['Magento\Customer\Helper\Data', new \Magento\Object(['account_url' => 1])],
+                ['Magento\Core\Model\Store\Config', new \Magento\Object(['config_flag' => 1])],
+                ['Magento\Core\Helper\Data', $this->getMock('Magento\Core\Helper\Data', [], [], '', false)],
+            ]));
+        $this->customerSession->expects($this->at(0))->method('isLoggedIn')->with()->will($this->returnValue(0));
+        $this->customerSession->expects($this->at(4))->method('isLoggedIn')->with()->will($this->returnValue(1));
+        $this->request->expects($this->once())->method('getParam')
+            ->with(\Magento\Customer\Helper\Data::REFERER_QUERY_PARAM_NAME)
+            ->will($this->returnValue('referer'));
+        $this->url->expects($this->once())->method('isOwnOriginUrl')->with();
+
+        $this->object->loginPostAction();
     }
 }
diff --git a/dev/tests/unit/testsuite/Magento/Data/Form/Element/MultiselectTest.php b/dev/tests/unit/testsuite/Magento/Data/Form/Element/MultiselectTest.php
index d1babd9d5273ce3365c0e39f8e9aa509ec8180bc..22504f1e6e0e327d97552b8aaeb86dc84b4c0354 100644
--- a/dev/tests/unit/testsuite/Magento/Data/Form/Element/MultiselectTest.php
+++ b/dev/tests/unit/testsuite/Magento/Data/Form/Element/MultiselectTest.php
@@ -53,4 +53,14 @@ class MultiselectTest extends \PHPUnit_Framework_TestCase
         $elementHtml = $this->_model->getElementHtml();
         $this->assertContains('<input type="hidden"', $elementHtml);
     }
+
+    /**
+     * Verify that js element is added
+     */
+    public function testGetAfterElementJs()
+    {
+        $this->_model->setAfterElementJs('<script language="text/javascript">var website = "website1";</script>');
+        $elementHtml = $this->_model->getAfterElementJs();
+        $this->assertContains('var website = "website1";', $elementHtml);
+    }
 }
diff --git a/dev/tests/unit/testsuite/Magento/Filesystem/Directory/ReadTest.php b/dev/tests/unit/testsuite/Magento/Filesystem/Directory/ReadTest.php
index b87ab89b1791b9d045d111f7f0ff4a5037b417cf..7fd5dc85e3237961dc029538cca6a4ad9ea78cf2 100644
--- a/dev/tests/unit/testsuite/Magento/Filesystem/Directory/ReadTest.php
+++ b/dev/tests/unit/testsuite/Magento/Filesystem/Directory/ReadTest.php
@@ -78,26 +78,9 @@ class ReadTest extends \PHPUnit_Framework_TestCase
 
     public function testStat()
     {
-        $this->driver->expects($this->once())
-            ->method('isExists')
-            ->will($this->returnValue(true));
         $this->driver->expects($this->once())
             ->method('stat')
             ->will($this->returnValue(array('some-stat-data')));
         $this->assertEquals(array('some-stat-data'), $this->read->stat('correct-path'));
     }
-
-    /**
-     * @expectedException \Magento\Filesystem\FilesystemException
-     */
-    public function testAssertExist()
-    {
-        $this->driver->expects($this->once())
-            ->method('isExists')
-            ->will($this->returnValue(false));
-        $this->read->stat('wrong-path');
-    }
-
-
-
 }
diff --git a/dev/tests/unit/testsuite/Magento/Install/Model/InstallerTest.php b/dev/tests/unit/testsuite/Magento/Install/Model/InstallerTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..f6b685f4e027de88021eb2fa1439cc83298e3176
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Install/Model/InstallerTest.php
@@ -0,0 +1,121 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Install\Model;
+
+class InstallerTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var \Magento\Install\Model\Installer
+     */
+    protected $_model;
+
+    /**
+     * @var \Magento\TestFramework\Helper\ObjectManager
+     */
+    protected $_objectManager;
+
+    /**
+     * Application chache model
+     *
+     * @var \Magento\App\CacheInterface
+     */
+    protected $_cache;
+
+    /**
+     * Application config model
+     *
+     * @var \Magento\Core\Model\ConfigInterface
+     */
+    protected $_config;
+
+    /**
+     * @var \Magento\App\Cache\StateInterface
+     */
+    protected $_cacheState;
+
+    /**
+     * @var \Magento\App\State
+     */
+    protected $_appState;
+
+    /**
+     * @var \Magento\App\Cache\TypeListInterface
+     */
+    protected $_cacheTypeList;
+
+    /**
+     * @var \Magento\Install\Model\Installer\Config
+     */
+    protected $_installerConfig;
+
+    /**
+     * Set up before test
+     */
+    public function setUp()
+    {
+        $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
+        $this->_cache = $this->getMock('\Magento\App\CacheInterface', array(), array(), '', false);
+        $this->_config = $this->getMock('\Magento\Core\Model\ConfigInterface', array(), array(), '', false);
+        $this->_cacheState = $this->getMock('\Magento\App\Cache\StateInterface', array(), array(), '', false);
+        $this->_cacheTypeList = $this->getMock('\Magento\App\Cache\TypeListInterface', array(), array(), '', false);
+        $this->_appState = $this->getMock('\Magento\App\State', array(), array(), '', false);
+        $this->_installerConfig =
+            $this->getMock('\Magento\Install\Model\Installer\Config', array(), array(), '', false);
+
+        $this->_model = $this->_objectManager->getObject(
+            'Magento\Install\Model\Installer',
+            array(
+                'cache' => $this->_cache,
+                'config' => $this->_config,
+                'cacheState' => $this->_cacheState,
+                'cacheTypeList' => $this->_cacheTypeList,
+                'appState' => $this->_appState,
+                'installerConfig' => $this->_installerConfig,
+            )
+        );
+    }
+
+    public function testFinish()
+    {
+        $cacheTypeListArray = array('one', 'two');
+
+        $this->_cache->expects($this->once())->method('clean');
+
+        $this->_config->expects($this->once())->method('reinit');
+
+        $this->_cacheState->expects($this->once())->method('persist');
+        $this->_cacheState->expects($this->exactly(count($cacheTypeListArray)))->method('setEnabled');
+
+        $this->_cacheTypeList->expects($this->once())->method('getTypes')
+            ->will($this->returnValue($cacheTypeListArray));
+
+        $this->_appState->expects($this->once())->method('setInstallDate')->with($this->greaterThanOrEqual(date('r')));
+
+        $this->_installerConfig->expects($this->once())->method('replaceTmpInstallDate')
+            ->with($this->greaterThanOrEqual(date('r')));
+
+        $this->assertSame($this->_model, $this->_model->finish());
+    }
+}
diff --git a/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/PriceTest.php b/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/PriceTest.php
index e7a3582960d7ada8618663c0242bff08cd194db8..8c12e0b27dc028d3733bff6063ffd13bfe7cf8df 100644
--- a/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/PriceTest.php
+++ b/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/PriceTest.php
@@ -32,62 +32,129 @@ namespace Magento\ProductAlert\Block\Product\View;
 class PriceTest extends \PHPUnit_Framework_TestCase
 {
     /**
-     * @var \Magento\TestFramework\Helper\ObjectManager
+     * @var PHPUnit_Framework_MockObject_MockObject|\Magento\ProductAlert\Helper\Data
      */
-    protected $_objectManager;
+    protected $_helper;
 
-    protected function setUp()
-    {
-        $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
-    }
+    /**
+     * @var PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Product
+     */
+    protected $_product;
 
-    public function testPrepareLayoutUrlIsSet()
-    {
-        $helper = $this->getMockBuilder('Magento\ProductAlert\Helper\Data')
-            ->disableOriginalConstructor()
-            ->setMethods(array('isPriceAlertAllowed', 'getSaveUrl'))
-            ->getMock();
-        $helper->expects($this->once())->method('isPriceAlertAllowed')->will($this->returnValue(true));
-        $helper->expects($this->once())->method('getSaveUrl')->with('price')->will($this->returnValue('http://url'));
+    /**
+     * @var PHPUnit_Framework_MockObject_MockObject|\Magento\Core\Model\Registry
+     */
+    protected $_registry;
 
-        $product = $this->getMockBuilder('Magento\Catalog\Model\Product')
-            ->disableOriginalConstructor()
-            ->setMethods(array('getCanShowPrice', 'getId', '__wakeup'))
-            ->getMock();
-        $product->expects($this->once())->method('getId')->will($this->returnValue(1));
-        $product->expects($this->once())->method('getCanShowPrice')->will($this->returnValue(true));
+    /**
+     * @var PHPUnit_Framework_MockObject_MockObject|\Magento\ProductAlert\Block\Product\View\Price
+     */
+    protected $_block;
 
-        $registry = $this->getMockBuilder('Magento\Core\Model\Registry')
+    /**
+     * @var PHPUnit_Framework_MockObject_MockObject|\Magento\Core\Model\Layout
+     */
+    protected $_layout;
+
+    protected function setUp()
+    {
+        $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
+        $this->_helper = $this->getMock(
+            'Magento\ProductAlert\Helper\Data', array('isPriceAlertAllowed', 'getSaveUrl'), array(), '', false
+        );
+        $this->_product = $this->getMock(
+            'Magento\Catalog\Model\Product', array('getCanShowPrice', 'getId', '__wakeup'), array(), '', false
+        );
+        $this->_product->expects($this->any())->method('getId')->will($this->returnValue(1));
+        $this->_registry = $this->getMockBuilder('Magento\Core\Model\Registry')
             ->disableOriginalConstructor()
             ->setMethods(array('registry'))
             ->getMock();
-        $registry->expects($this->once())
-            ->method('registry')
-            ->with('current_product')
-            ->will($this->returnValue($product));
-
-        $block = $this->_objectManager->getObject(
+        $this->_block = $objectManager->getObject(
             'Magento\ProductAlert\Block\Product\View\Price',
             array(
-                'helper' => $helper,
-                'registry' => $registry,
+                'helper' => $this->_helper,
+                'registry' => $this->_registry,
             )
         );
+        $this->_layout = $this->getMock('Magento\Core\Model\Layout', array(), array(), '', false);
+    }
 
-        $layout = $this->getMockBuilder('Magento\Core\Model\Layout')
-            ->disableOriginalConstructor()
-            ->getMock();
+    public function testSetTemplatePriceAlertAllowed()
+    {
+        $this->_helper->expects($this->once())->method('isPriceAlertAllowed')->will($this->returnValue(true));
+        $this->_helper
+            ->expects($this->once())
+            ->method('getSaveUrl')
+            ->with('price')
+            ->will($this->returnValue('http://url'))
+        ;
+
+        $this->_product->expects($this->once())->method('getCanShowPrice')->will($this->returnValue(true));
 
-        $block->setTemplate('path/to/template.phtml');
-        $block->setLayout($layout);
+        $this->_registry->expects($this->once())
+            ->method('registry')
+            ->with('current_product')
+            ->will($this->returnValue($this->_product));
 
-        $this->assertEquals('path/to/template.phtml', $block->getTemplate());
-        $this->assertEquals('http://url', $block->getSignupUrl());
+        $this->_block->setLayout($this->_layout);
+        $this->_block->setTemplate('path/to/template.phtml');
+
+        $this->assertEquals('path/to/template.phtml', $this->_block->getTemplate());
+        $this->assertEquals('http://url', $this->_block->getSignupUrl());
     }
 
-    public function testPrepareLayoutTemplateReseted()
+    /**
+     * @param bool $priceAllowed
+     * @param bool $showProductPrice
+     *
+     * @dataProvider setTemplatePriceAlertNotAllowedDataProvider
+     */
+    public function testSetTemplatePriceAlertNotAllowed($priceAllowed, $showProductPrice)
     {
-        $block = $this->_objectManager->getObject('Magento\ProductAlert\Block\Product\View\Price');
-        $this->assertEquals('', $block->getTemplate());
+        $this->_helper->expects($this->once())->method('isPriceAlertAllowed')->will($this->returnValue($priceAllowed));
+        $this->_helper->expects($this->never())->method('getSaveUrl');
+
+        $this->_product->expects($this->any())->method('getCanShowPrice')->will($this->returnValue($showProductPrice));
+
+        $this->_registry->expects($this->once())
+            ->method('registry')
+            ->with('current_product')
+            ->will($this->returnValue($this->_product));
+
+        $this->_block->setLayout($this->_layout);
+        $this->_block->setTemplate('path/to/template.phtml');
+
+        $this->assertEquals('', $this->_block->getTemplate());
+        $this->assertNull($this->_block->getSignupUrl());
+    }
+
+    /**
+     * @return array
+     */
+    public function setTemplatePriceAlertNotAllowedDataProvider()
+    {
+        return array(
+            'price alert is not allowed' => array(false, true),
+            'no product price'  => array(true, false),
+            'price alert is not allowed and no product price' => array(false, false),
+        );
+    }
+
+    public function testSetTemplateNoProduct()
+    {
+        $this->_helper->expects($this->once())->method('isPriceAlertAllowed')->will($this->returnValue(true));
+        $this->_helper->expects($this->never())->method('getSaveUrl');
+
+        $this->_registry->expects($this->once())
+            ->method('registry')
+            ->with('current_product')
+            ->will($this->returnValue(null));
+
+        $this->_block->setLayout($this->_layout);
+        $this->_block->setTemplate('path/to/template.phtml');
+
+        $this->assertEquals('', $this->_block->getTemplate());
+        $this->assertNull($this->_block->getSignupUrl());
     }
 }
diff --git a/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/StockTest.php b/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/StockTest.php
index 8711f02aa725823f4828987bb92681e400539848..264c710940abd426ee848dd99db38774b8e1dce4 100644
--- a/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/StockTest.php
+++ b/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/StockTest.php
@@ -32,65 +32,126 @@ namespace Magento\ProductAlert\Block\Product\View;
 class StockTest extends \PHPUnit_Framework_TestCase
 {
     /**
-     * @var \Magento\TestFramework\Helper\ObjectManager
+     * @var PHPUnit_Framework_MockObject_MockObject|\Magento\ProductAlert\Helper\Data
      */
-    protected $_objectManager;
+    protected $_helper;
+
+    /**
+     * @var PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Product
+     */
+    protected $_product;
+
+    /**
+     * @var PHPUnit_Framework_MockObject_MockObject|\Magento\Core\Model\Registry
+     */
+    protected $_registry;
+
+    /**
+     * @var PHPUnit_Framework_MockObject_MockObject|\Magento\ProductAlert\Block\Product\View\Stock
+     */
+    protected $_block;
+
+    /**
+     * @var PHPUnit_Framework_MockObject_MockObject|\Magento\Core\Model\Layout
+     */
+    protected $_layout;
 
     protected function setUp()
     {
-        $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
+        $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this);
+        $this->_helper = $this->getMock(
+            'Magento\ProductAlert\Helper\Data', array('isStockAlertAllowed', 'getSaveUrl'), array(), '', false
+        );
+        $this->_product = $this->getMock(
+            'Magento\Catalog\Model\Product', array('isAvailable', 'getId', '__wakeup'), array(), '', false
+        );
+        $this->_product->expects($this->any())->method('getId')->will($this->returnValue(1));
+        $this->_registry = $this->getMockBuilder('Magento\Core\Model\Registry')
+            ->disableOriginalConstructor()
+            ->setMethods(array('registry'))
+            ->getMock();
+        $this->_block = $objectManager->getObject(
+            'Magento\ProductAlert\Block\Product\View\Stock',
+            array(
+                'helper' => $this->_helper,
+                'registry' => $this->_registry,
+            )
+        );
+        $this->_layout = $this->getMock('Magento\Core\Model\Layout', array(), array(), '', false);
     }
 
-    public function testPrepareLayoutUrlIsSet()
+    public function testSetTemplateStockUrlAllowed()
     {
-        $helper = $this->getMockBuilder('Magento\ProductAlert\Helper\Data')
-            ->disableOriginalConstructor()
-            ->setMethods(array('isStockAlertAllowed', 'getSaveUrl'))
-            ->getMock();
-        $helper->expects($this->once())->method('isStockAlertAllowed')->will($this->returnValue(true));
-        $helper->expects($this->once())
+        $this->_helper->expects($this->once())->method('isStockAlertAllowed')->will($this->returnValue(true));
+        $this->_helper->expects($this->once())
             ->method('getSaveUrl')
             ->with('stock')
             ->will($this->returnValue('http://url'));
 
-        $product = $this->getMockBuilder('Magento\Catalog\Model\Product')
-            ->disableOriginalConstructor()
-            ->setMethods(array('isAvailable', 'getId', '__wakeup'))
-            ->getMock();
-        $product->expects($this->once())->method('getId')->will($this->returnValue(1));
-        $product->expects($this->once())->method('isAvailable')->will($this->returnValue(false));
+        $this->_product->expects($this->once())->method('isAvailable')->will($this->returnValue(false));
 
-        $registry = $this->getMockBuilder('Magento\Core\Model\Registry')
-            ->disableOriginalConstructor()
-            ->setMethods(array('registry'))
-            ->getMock();
-        $registry->expects($this->once())
+        $this->_registry->expects($this->once())
             ->method('registry')
             ->with('current_product')
-            ->will($this->returnValue($product));
+            ->will($this->returnValue($this->_product));
 
-        $block = $this->_objectManager->getObject(
-            'Magento\ProductAlert\Block\Product\View\Stock',
-            array(
-                'helper' => $helper,
-                'registry' => $registry,
-            )
-        );
+        $this->_block->setLayout($this->_layout);
+        $this->_block->setTemplate('path/to/template.phtml');
 
-        $layout = $this->getMockBuilder('Magento\Core\Model\Layout')
-            ->disableOriginalConstructor()
-            ->getMock();
+        $this->assertEquals('path/to/template.phtml', $this->_block->getTemplate());
+        $this->assertEquals('http://url', $this->_block->getSignupUrl());
+    }
+
+    /**
+     * @param bool $stockAlertAllowed
+     * @param bool $productAvailable
+     * @dataProvider setTemplateStockUrlNotAllowedDataProvider
+     */
+    public function testSetTemplateStockUrlNotAllowed($stockAlertAllowed, $productAvailable)
+    {
+        $this->_helper
+            ->expects($this->once())
+            ->method('isStockAlertAllowed')
+            ->will($this->returnValue($stockAlertAllowed));
+        $this->_helper->expects($this->never())->method('getSaveUrl');
 
-        $block->setTemplate('path/to/template.phtml');
-        $block->setLayout($layout);
+        $this->_product->expects($this->any())->method('isAvailable')->will($this->returnValue($productAvailable));
 
-        $this->assertEquals('path/to/template.phtml', $block->getTemplate());
-        $this->assertEquals('http://url', $block->getSignupUrl());
+        $this->_registry->expects($this->once())
+            ->method('registry')
+            ->with('current_product')
+            ->will($this->returnValue($this->_product));
+
+        $this->_block->setLayout($this->_layout);
+        $this->_block->setTemplate('path/to/template.phtml');
+
+        $this->assertEquals('', $this->_block->getTemplate());
+        $this->assertNull($this->_block->getSignupUrl());
     }
 
-    public function testPrepareLayoutTemplateReseted()
+    public function setTemplateStockUrlNotAllowedDataProvider()
     {
-        $block = $this->_objectManager->getObject('Magento\ProductAlert\Block\Product\View\Stock');
-        $this->assertEquals('', $block->getTemplate());
+        return array(
+            'stock alert not allowed' => array(false, false),
+            'product is available (no alert)' => array(true, true),
+            'stock alert not allowed and product is available' => array(false, true),
+        );
+    }
+
+    public function testSetTemplateNoProduct()
+    {
+        $this->_helper->expects($this->once())->method('isStockAlertAllowed')->will($this->returnValue(true));
+        $this->_helper->expects($this->never())->method('getSaveUrl');
+
+        $this->_registry->expects($this->once())
+            ->method('registry')
+            ->with('current_product')
+            ->will($this->returnValue(null));
+
+        $this->_block->setLayout($this->_layout);
+        $this->_block->setTemplate('path/to/template.phtml');
+
+        $this->assertEquals('', $this->_block->getTemplate());
+        $this->assertNull($this->_block->getSignupUrl());
     }
 }
diff --git a/dev/tests/unit/testsuite/Magento/Sales/Controller/Billing/AgreementTest.php b/dev/tests/unit/testsuite/Magento/Sales/Controller/Billing/AgreementTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..ff3c6aeb7dafc8048262a378a2de04246546ba73
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Sales/Controller/Billing/AgreementTest.php
@@ -0,0 +1,162 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Sales\Controller\Billing;
+
+class AgreementTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var \Magento\Sales\Controller\Billing\Agreement
+     */
+    protected $_controller;
+
+    /**
+     * @var \Magento\ObjectManager|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $_objectManager;
+
+    /**
+     * @var \Magento\App\RequestInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $_request;
+
+    /**
+     * @var \Magento\Core\Model\Registry|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $_registry;
+
+    /**
+     * @var \Magento\Customer\Model\Session|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $_session;
+
+    /**
+     * @var \Magento\Message\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $_messageManager;
+
+    /**
+     * @var \Magento\Sales\Model\Billing\Agreement|\PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $_agreement;
+
+    protected function setUp()
+    {
+        $this->_session = $this->getMock('Magento\Customer\Model\Session', array(), array(), '', false);
+
+        $this->_agreement = $this->getMock(
+            'Magento\Sales\Model\Billing\Agreement',
+            array('load', 'getId', 'getCustomerId', 'getReferenceId', 'canCancel', 'cancel', '__wakeup'),
+            array(), '', false
+        );
+        $this->_agreement->expects($this->once())->method('load')->with(15)->will($this->returnSelf());
+        $this->_agreement->expects($this->once())->method('getId')->will($this->returnValue(15));
+        $this->_agreement->expects($this->once())->method('getCustomerId')->will($this->returnValue(871));
+
+        $this->_objectManager = $this->getMock('Magento\ObjectManager');
+        $this->_objectManager->expects($this->atLeastOnce())->method('get')->will($this->returnValueMap(array(
+            array('Magento\Customer\Model\Session', $this->_session),
+        )));
+        $this->_objectManager
+            ->expects($this->once())
+            ->method('create')
+            ->with('Magento\Sales\Model\Billing\Agreement')
+            ->will($this->returnValue($this->_agreement))
+        ;
+
+        $this->_request = $this->getMock('Magento\App\RequestInterface');
+        $this->_request->expects($this->once())->method('getParam')->with('agreement')->will($this->returnValue(15));
+
+        $response = $this->getMock('Magento\App\ResponseInterface');
+
+        $redirect = $this->getMock('Magento\App\Response\RedirectInterface');
+
+        $this->_messageManager = $this->getMock('Magento\Message\ManagerInterface');
+
+        $context = $this->getMock('Magento\App\Action\Context', array(), array(), '', false);
+        $context->expects($this->any())->method('getObjectManager')->will($this->returnValue($this->_objectManager));
+        $context->expects($this->any())->method('getRequest')->will($this->returnValue($this->_request));
+        $context->expects($this->any())->method('getResponse')->will($this->returnValue($response));
+        $context->expects($this->any())->method('getRedirect')->will($this->returnValue($redirect));
+        $context->expects($this->any())->method('getMessageManager')->will($this->returnValue($this->_messageManager));
+
+        $this->_registry = $this->getMock('Magento\Core\Model\Registry', array(), array(), '', false);
+
+        $title = $this->getMock('Magento\App\Action\Title', array(), array(), '', false);
+
+        $this->_controller = new \Magento\Sales\Controller\Billing\Agreement($context, $this->_registry, $title);
+    }
+
+    public function testCancelActionSuccess()
+    {
+        $this->_agreement->expects($this->once())->method('getReferenceId')->will($this->returnValue('r15'));
+        $this->_agreement->expects($this->once())->method('canCancel')->will($this->returnValue(true));
+        $this->_agreement->expects($this->once())->method('cancel');
+
+        $noticeMessage = 'The billing agreement "r15" has been canceled.';
+        $this->_session->expects($this->once())->method('getCustomerId')->will($this->returnValue(871));
+        $this->_messageManager->expects($this->once())->method('addNotice')->with($noticeMessage);
+        $this->_messageManager->expects($this->never())->method('addError');
+
+        $this->_registry
+            ->expects($this->once())
+            ->method('register')
+            ->with('current_billing_agreement', $this->identicalTo($this->_agreement))
+        ;
+
+        $this->_controller->cancelAction();
+    }
+
+    public function testCancelActionAgreementDoesNotBelongToCustomer()
+    {
+        $this->_agreement->expects($this->never())->method('canCancel');
+        $this->_agreement->expects($this->never())->method('cancel');
+
+        $errorMessage = 'Please specify the correct billing agreement ID and try again.';
+        $this->_session->expects($this->once())->method('getCustomerId')->will($this->returnValue(938));
+        $this->_messageManager->expects($this->once())->method('addError')->with($errorMessage);
+
+        $this->_registry->expects($this->never())->method('register');
+
+        $this->_controller->cancelAction();
+    }
+
+    public function testCancelActionAgreementStatusDoesNotAllowToCancel()
+    {
+        $this->_agreement->expects($this->once())->method('canCancel')->will($this->returnValue(false));
+        $this->_agreement->expects($this->never())->method('cancel');
+
+        $this->_session->expects($this->once())->method('getCustomerId')->will($this->returnValue(871));
+        $this->_messageManager->expects($this->never())->method('addNotice');
+        $this->_messageManager->expects($this->never())->method('addError');
+
+        $this->_registry
+            ->expects($this->once())
+            ->method('register')
+            ->with('current_billing_agreement', $this->identicalTo($this->_agreement))
+        ;
+
+        $this->_controller->cancelAction();
+    }
+}
diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ThemeDeploymentTest.php b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ThemeDeploymentTest.php
index 6b997f465535a9a93d14c53ffa63be4e36893b5d..e7e8486512e070bc7294d867e3e47cacaa542c24 100644
--- a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ThemeDeploymentTest.php
+++ b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/ThemeDeploymentTest.php
@@ -58,9 +58,14 @@ class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase
         $this->filesystem->expects($this->any())
             ->method('getPath')
             ->with(\Magento\Filesystem::ROOT)
-            ->will($this->returnValue(BP));
+            ->will($this->returnValue(str_replace('\\', '/', BP)));
 
-        $this->_cssUrlResolver = new \Magento\View\Url\CssResolver($this->filesystem);
+        $viewFilesystem = $this->getMock('Magento\View\Filesystem', array('normalizePath'), array(), '', false);
+        $viewFilesystem->expects($this->any())
+            ->method('normalizePath')
+            ->will($this->returnArgument(0));
+
+        $this->_cssUrlResolver = new \Magento\View\Url\CssResolver($this->filesystem, $viewFilesystem);
         $this->_tmpDir = TESTS_TEMP_DIR . '/tool_theme_deployment';
 
         $this->filesystemAdapter = new \Magento\Filesystem\Driver\File();
@@ -108,7 +113,7 @@ class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase
                 $conflictPermitted,
                 $conflictForbidden,
                 'Conflicts: the following extensions are added both to permitted and forbidden lists: ' .
-                    'conflict1, conflict2',
+                'conflict1, conflict2',
             ),
         );
     }
@@ -119,11 +124,6 @@ class ThemeDeploymentTest extends \PHPUnit_Framework_TestCase
         $forbidden = __DIR__ . '/_files/ThemeDeployment/run/forbidden.php';
         $fixture = include __DIR__ . '/_files/ThemeDeployment/run/fixture.php';
 
-        $this->filesystem->expects($this->any())
-            ->method('getPath')
-            ->with(\Magento\Filesystem::ROOT)
-            ->will($this->returnValue(BP));
-
         $object = new \Magento\Tools\View\Generator\ThemeDeployment($this->_cssUrlResolver, $this->_tmpDir, $permitted,
             $forbidden);
         $object->run($fixture['copyRules']);
diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/_files/fixture_themes.php b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/_files/fixture_themes.php
index 213cc8694a9e024c9458d8c2c0f8f924dc78d00f..771eafd00a33441507b37c03259092de5a143a6b 100644
--- a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/_files/fixture_themes.php
+++ b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/_files/fixture_themes.php
@@ -60,7 +60,7 @@ return array(
         ),
         'filesystem_glob_map' => array(
             array(
-                '#.*_.*#', '/base/dir/area_one/fixture/theme_one/',
+                '*_*', '/base/dir/area_one/fixture/theme_one/',
                 array('/base/dir/area_one/fixture/theme_one/Magento_Core'),
             ),
         ),
@@ -103,7 +103,7 @@ return array(
         ),
         'filesystem_glob_map' => array(
             array(
-                '#.*_.*#', '/base/dir/area_one/fixture/theme_two/',
+                '*_*', '/base/dir/area_one/fixture/theme_two/',
                 array(
                     '/base/dir/area_one/fixture/theme_two/Fixture_ModuleOne',
                     '/base/dir/area_one/fixture/theme_two/Fixture_ModuleTwo',
@@ -160,7 +160,7 @@ return array(
         ),
         'filesystem_glob_map' => array(
             array(
-                '#.*_.*#', '/base/dir/area_two/fixture/theme_three/',
+                '*_*', '/base/dir/area_two/fixture/theme_three/',
                 array(),
             ),
         ),
diff --git a/dev/tests/unit/testsuite/Magento/Usa/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Usa/Helper/DataTest.php
new file mode 100755
index 0000000000000000000000000000000000000000..498312d7e0cf5a07c954432cde7c69a498b1802c
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Usa/Helper/DataTest.php
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+namespace Magento\Usa\Helper;
+
+
+class DataTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var \Magento\Usa\Helper\Data
+     */
+    protected $_helperData;
+
+    /**
+     *
+     */
+    protected function setUp()
+    {
+        $helper = new \Magento\TestFramework\Helper\ObjectManager($this);
+        $arguments = array(
+            'context' => $this->getMock('Magento\App\Helper\Context', array(), array(), '', false),
+            'locale' => $this->getMock('Magento\Core\Model\Locale', array(), array(), '', false)
+        );
+
+        $this->_helperData = $helper->getObject('Magento\Usa\Helper\Data', $arguments);
+    }
+
+    /**
+     * @covers \Magento\Usa\Helper\Data::displayGirthValue
+     * @dataProvider shippingMethodDataProvider
+     */
+    public function testDisplayGirthValue($shippingMethod)
+    {
+        $this->assertTrue($this->_helperData->displayGirthValue($shippingMethod));
+    }
+
+    /**
+     * @covers \Magento\Usa\Helper\Data::displayGirthValue
+     */
+    public function testDisplayGirthValueFalse()
+    {
+        $this->assertFalse($this->_helperData->displayGirthValue('test_shipping_method'));
+    }
+
+    /**
+     * @return array shipping method name
+     */
+    public function shippingMethodDataProvider()
+    {
+        return array(
+            array('usps_0_FCLE'), // First-Class Mail Large Envelope
+            array('usps_1'),      // Priority Mail
+            array('usps_2'),      // Priority Mail Express Hold For Pickup
+            array('usps_3'),      // Priority Mail Express
+            array('usps_4'),      // Standard Post
+            array('usps_6'),      // Media Mail
+            array('usps_INT_1'),  // Priority Mail Express International
+            array('usps_INT_2'),  // Priority Mail International
+            array('usps_INT_4'),  // Global Express Guaranteed (GXG)
+            array('usps_INT_7'),  // Global Express Guaranteed Non-Document Non-Rectangular
+            array('usps_INT_8'),  // Priority Mail International Flat Rate Envelope
+            array('usps_INT_9'),  // Priority Mail International Medium Flat Rate Box
+            array('usps_INT_10'), // Priority Mail Express International Flat Rate Envelope
+            array('usps_INT_11'), // Priority Mail International Large Flat Rate Box
+            array('usps_INT_12'), // USPS GXG Envelopes
+            array('usps_INT_14'), // First-Class Mail International Large Envelope
+            array('usps_INT_16'), // Priority Mail International Small Flat Rate Box
+            array('usps_INT_20'), // Priority Mail International Small Flat Rate Envelope
+            array('usps_INT_26'), // Priority Mail Express International Flat Rate Boxes
+        );
+    }
+}
diff --git a/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilderTest.php b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilderTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..b72c4fc0a9daa63f45ed3d201e606326da2332ef
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilderTest.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @category    Magento
+ * @package     Magento
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Usa\Model\Shipping\Carrier\Dhl\Label\Pdf;
+
+class PageBuilderTest extends \PHPUnit_Framework_TestCase
+{
+    public function testAddDestinationFacilityCodewithUtf8()
+    {
+        $page = $this->getMockBuilder('\Zend_Pdf_Page')
+            ->disableOriginalConstructor()
+            ->getMock();
+        $page->expects($this->once())
+            ->method('drawText')
+            ->with(
+                $this->equalTo('Nürnberg-Österreich-Zürich'),
+                $this->anything(),
+                $this->anything(),
+                $this->equalTo('UTF-8')
+            );
+
+        $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this);
+        /** @var \Magento\Usa\Model\Shipping\Carrier\Dhl\Label\Pdf\PageBuilder $pageBuilder */
+        $pageBuilder = $objectManagerHelper->getObject('\Magento\Usa\Model\Shipping\Carrier\Dhl\Label\Pdf\PageBuilder');
+        $pageBuilder->setPage($page);
+        $pageBuilder->addDestinationFacilityCode('Nürnberg', 'Österreich', 'Zürich');
+    }
+}
+ 
\ No newline at end of file
diff --git a/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/Usps/Source/GenericTest.php b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/Usps/Source/GenericTest.php
new file mode 100755
index 0000000000000000000000000000000000000000..bc6899c7746c395df28dfc96c3b57fb957887609
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/Usps/Source/GenericTest.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Usa\Model\Shipping\Carrier\Usps\Source;
+
+class GenericTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @var \Magento\Usa\Model\Shipping\Carrier\Usps\Source\Generic
+     */
+    protected $_generic;
+
+    /**
+     * @var \Magento\Usa\Model\Shipping\Carrier\Usps
+     */
+    protected $_uspsModel;
+
+    public function setUp()
+    {
+        $helper = new \Magento\TestFramework\Helper\ObjectManager($this);
+        $this->_uspsModel = $this->getMockBuilder('Magento\Usa\Model\Shipping\Carrier\Usps')
+            ->setMethods(array('getCode'))
+            ->disableOriginalConstructor()
+            ->getMock();
+
+        $this->_generic = $helper->getObject(
+            'Magento\Usa\Model\Shipping\Carrier\Usps\Source\Generic',
+            array('shippingUsps' => $this->_uspsModel)
+        );
+    }
+
+    /**
+     * @dataProvider getCodeDataProvider
+     * @param $expected array
+     * @param $options Magento\Usa\Model\Shipping\Carrier\Usps::getCode result
+     */
+    public function testToOptionArray($expected, $options)
+    {
+        $this->_uspsModel->expects($this->any())
+            ->method('getCode')
+            ->will($this->returnValue($options));
+
+        $this->assertEquals($expected, $this->_generic->toOptionArray());
+    }
+
+    /**
+     * @return array expected result and return of Magento\Usa\Model\Shipping\Carrier\Usps::getCode
+     */
+    public function getCodeDataProvider()
+    {
+        return array(
+            array(array(array('value' => 'Val', 'label' => 'Label')), array('Val' => 'Label')),
+            array(array(), false)
+        );
+    }
+}
diff --git a/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/UspsTest.php b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/UspsTest.php
new file mode 100755
index 0000000000000000000000000000000000000000..9c7fa299abcc4462b4e79ccea83f23959a43f3a5
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/UspsTest.php
@@ -0,0 +1,215 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+
+namespace Magento\Usa\Model\Shipping\Carrier;
+
+class UspsTest extends \PHPUnit_Framework_TestCase
+{
+
+    /**
+     * @var \Magento\Usa\Model\Shipping\Carrier\Usps
+     */
+    protected $_model;
+
+    /**
+     * @var \PHPUnit_Framework_MockObject_MockObject
+     */
+    protected $_httpResponse;
+
+    /**
+     * @var \Magento\TestFramework\Helper\ObjectManager
+     */
+    protected $_helper;
+
+    public function setUp()
+    {
+        $this->_helper = new \Magento\TestFramework\Helper\ObjectManager($this);
+
+        $coreStoreConfig = $this->getMockBuilder('\Magento\Core\Model\Store\Config')
+            ->setMethods(array('getConfigFlag', 'getConfig'))
+            ->disableOriginalConstructor()
+            ->getMock();
+        $coreStoreConfig->expects($this->any())
+            ->method('getConfigFlag')
+            ->will($this->returnValue(true));
+        $coreStoreConfig->expects($this->any())
+            ->method('getConfig')
+            ->will($this->returnCallback(array($this, 'coreStoreConfigGetConfig')));
+
+        // xml element factory
+        $xmlElFactory = $this->getMockBuilder('\Magento\Usa\Model\Simplexml\ElementFactory')
+            ->disableOriginalConstructor()
+            ->setMethods(array('create'))
+            ->getMock();
+        $xmlElFactory->expects($this->any())
+            ->method('create')
+            ->will(
+                $this->returnCallback(
+                    function ($data) {
+                        $oM = new \Magento\TestFramework\Helper\ObjectManager($this);
+                        return  $oM->getObject('\Magento\Usa\Model\Simplexml\Element', array('data' => $data['data']));
+                    }
+                )
+            );
+
+        // rate factory
+        $rateFactory = $this->getMockBuilder('\Magento\Shipping\Model\Rate\ResultFactory')
+            ->disableOriginalConstructor()
+            ->setMethods(array('create'))
+            ->getMock();
+        $rateResult = $this->getMockBuilder('\Magento\Shipping\Model\Rate\Result')
+            ->disableOriginalConstructor()
+            ->setMethods(null)
+            ->getMock();
+        $rateFactory->expects($this->any())
+            ->method('create')
+            ->will($this->returnValue($rateResult));
+
+        // rate method factory
+        $rateMethodFactory = $this->getMockBuilder('\Magento\Shipping\Model\Rate\Result\MethodFactory')
+            ->disableOriginalConstructor()
+            ->setMethods(array('create'))
+            ->getMock();
+        $rateMethod = $this->getMockBuilder('Magento\Shipping\Model\Rate\Result\Method')
+            ->disableOriginalConstructor()
+            ->setMethods(array('setPrice'))
+            ->getMock();
+        $rateMethod->expects($this->any())
+            ->method('setPrice')
+            ->will($this->returnSelf());
+
+        $rateMethodFactory->expects($this->any())
+            ->method('create')
+            ->will($this->returnValue($rateMethod));
+
+        // http client
+        $this->_httpResponse = $this->getMockBuilder('\Zend_Http_Response')
+            ->disableOriginalConstructor()
+            ->setMethods(array('getBody'))
+            ->getMock();
+
+        $httpClient = $this->getMockBuilder('\Zend_Http_Client')
+            ->disableOriginalConstructor()
+            ->setMethods(array('request'))
+            ->getMock();
+        $httpClient->expects($this->any())
+            ->method('request')
+            ->will($this->returnValue($this->_httpResponse));
+
+        $httpClientFactory = $this->getMockBuilder('\Zend_Http_ClientFactory')
+            ->disableOriginalConstructor()
+            ->setMethods(array('create'))
+            ->getMock();
+        $httpClientFactory->expects($this->any())
+            ->method('create')
+            ->will($this->returnValue($httpClient));
+
+        $data = array(
+            'id' => 'usps',
+            'store' => '1'
+        );
+
+        $arguments = array(
+            'coreStoreConfig' => $coreStoreConfig,
+            'xmlElFactory' => $xmlElFactory,
+            'rateFactory' => $rateFactory,
+            'rateMethodFactory' => $rateMethodFactory,
+            'httpClientFactory' => $httpClientFactory,
+            'data' => $data
+        );
+
+        $this->_model = $this->_helper->getObject('\Magento\Usa\Model\Shipping\Carrier\Usps', $arguments);
+    }
+
+    /**
+     * @dataProvider codeDataProvider
+     */
+    public function testGetCodeArray($code)
+    {
+        $this->assertNotEmpty($this->_model->getCode($code));
+    }
+
+    public function testGetCodeBool()
+    {
+        $this->assertFalse($this->_model->getCode('test_code'));
+    }
+
+    public function testCollectRates()
+    {
+        $this->_httpResponse->expects($this->any())
+            ->method('getBody')
+            ->will($this->returnValue(file_get_contents(__DIR__ . '/_files/success_usps_response_rates.xml')));
+        // for setRequest
+        $request_params = include __DIR__ . '/_files/rates_request_data.php';
+        $request = $this->_helper->getObject('Magento\Shipping\Model\Rate\Request', $request_params);
+
+        $this->assertNotEmpty($this->_model->collectRates($request)->getAllRates());
+    }
+
+    public function testReturnOfShipment()
+    {
+        $this->_httpResponse->expects($this->any())
+            ->method('getBody')
+            ->will(
+                $this->returnValue(
+                    file_get_contents(__DIR__ . '/_files/success_usps_response_return_shipment.xml')
+                )
+            );
+        $request_params = include __DIR__ . '/_files/return_shipment_request_data.php';
+        $request = $this->_helper->getObject('Magento\Shipping\Model\Shipment\ReturnShipment', $request_params);
+        $this->assertNotEmpty($this->_model->returnOfShipment($request)->getInfo()[0]['tracking_number']);
+
+    }
+
+    /**
+     * Callback function, emulates getConfig function
+     * @param $path
+     * @return null|string
+     */
+    public function coreStoreConfigGetConfig($path)
+    {
+        switch ($path) {
+            case 'carriers/usps/allowed_methods':
+                return '0_FCLE,0_FCL,0_FCP,1,2,3,4,6,7,13,16,17,22,23,25,27,28,33,34,35,36,37,42,43,53,'
+                    . '55,56,57,61,INT_1,INT_2,INT_4,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,INT_12,INT_13,INT_14,'
+                    . 'INT_15,INT_16,INT_20,INT_26';
+            default:
+                return null;
+        }
+    }
+
+    /**
+     * @return array
+     */
+    public function codeDataProvider()
+    {
+        return array(
+            array('container'),
+            array('machinable'),
+            array('method'),
+            array('size')
+        );
+    }
+
+}
diff --git a/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/rates_request_data.php b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/rates_request_data.php
new file mode 100644
index 0000000000000000000000000000000000000000..52663ad43636b99c9dcd7a8dcd5b2a71f0057730
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/rates_request_data.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+return array(
+    'data' => array(
+        'dest_country_id' => 'US',
+        'dest_region_id' => '12',
+        'dest_region_code' => 'CA',
+        'dest_street' => 'main st1',
+        'dest_city' => 'Los Angeles',
+        'dest_postcode' => '90032',
+        'package_value' => '5',
+        'package_value_with_discount' => '5',
+        'package_weight' => '5',
+        'package_qty' => '1',
+        'package_physical_value' => '5',
+        'free_method_weight' => '5',
+        'store_id' => '1',
+        'website_id' => '1',
+        'free_shipping' => '0',
+        'limit_carrier' => 'null',
+        'base_subtotal_incl_tax' => '5',
+        'orig_country_id' => 'US',
+        'country_id' => 'US',
+        'region_id' => '12',
+        'city'=> 'Culver City',
+        'postcode' => '90034',
+        'usps_userid' => '213MAGEN6752',
+        'usps_container' => 'VARIABLE',
+        'usps_size' => 'REGULAR',
+        'girth' => null,
+        'height' => null,
+        'length' => null,
+        'width' => null,
+    )
+);
\ No newline at end of file
diff --git a/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/return_shipment_request_data.php b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/return_shipment_request_data.php
new file mode 100644
index 0000000000000000000000000000000000000000..706fbd94a74ab26696f649b413e0a88c23076dd9
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/return_shipment_request_data.php
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
+ */
+return array(
+    'data' => array(
+        'shipper_contact_person_name' => 'testO',
+        'shipper_contact_person_first_name' => 'test ',
+        'shipper_contact_person_last_name' => 'O',
+        'shipper_contact_company_name' => 'testO',
+        'shipper_contact_phone_number' => '23424',
+        'shipper_email' => 'test@domain.ru',
+        'shipper_address_street' => 'mainst1',
+        'shipper_address_street1' => 'mainst1',
+        'shipper_address_street2' => '',
+        'shipper_address_city' => 'Los Angeles',
+        'shipper_address_state_or_province_code' => 'CA',
+        'shipper_address_postal_code' => '90032',
+        'shipper_address_country_code' => 'US',
+        'recipient_contact_person_name' => 'DK',
+        'recipient_contact_person_first_name' => 'D',
+        'recipient_contact_person_last_name' => 'K',
+        'recipient_contact_company_name' => 'wsdfsdf',
+        'recipient_contact_phone_number' => '234324',
+        'recipient_email' => '',
+        'recipient_address_street' => '43514 Christy Street',
+        'recipient_address_street1' => '43514 Christy Street',
+        'recipient_address_street2' => '43514 Christy Street',
+        'recipient_address_city' => 'Fremont',
+        'recipient_address_state_or_province_code' => 'CA',
+        'recipient_address_region_code' => 'CA',
+        'recipient_address_postal_code' => '94538',
+        'recipient_address_country_code' => 'US',
+        'shipping_method' => '6',
+        'package_weight' => '5',
+        'base_currency_code' => 'USD',
+        'store_id' => '1',
+        'reference_data' => '#100000001 P',
+        'packages' => array(
+            1 => array(
+                'params' => array(
+                    'container' => '',
+                    'weight' => 5,
+                    'custom_value' => '',
+                    'length' => '',
+                    'width' => '',
+                    'height' => '',
+                    'weight_units' => 'POUND',
+                    'dimension_units' => 'INCH',
+                    'content_type' => '',
+                    'content_type_other' => '',
+                    'delivery_confirmation' => 'True'
+                ),
+                'items' => array(
+                    '2' => array(
+                        'qty' => '1',
+                        'customs_value' => '5',
+                        'price' => '5.0000',
+                        'name' => 'prod1',
+                        'weight' => '5.0000',
+                        'product_id' => '1',
+                        'order_item_id' => 2
+                    )
+                )
+            )
+        ),
+        'order_shipment' => null
+    )
+);
\ No newline at end of file
diff --git a/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/success_usps_response_rates.xml b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/success_usps_response_rates.xml
new file mode 100644
index 0000000000000000000000000000000000000000..28593bbb920411c61b5f38e2cae7468e194c890a
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/success_usps_response_rates.xml
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0)
+ * that is bundled with this package in the file LICENSE_AFL.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/afl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
+ */
+-->
+<RateV4Response>
+   <Package ID="0">
+      <ZipOrigination>90034</ZipOrigination>
+      <ZipDestination>90032</ZipDestination>
+      <Pounds>5</Pounds>
+      <Ounces>0</Ounces>
+      <Size>REGULAR</Size>
+      <Machinable>TRUE</Machinable>
+      <Zone>1</Zone>
+      <Postage CLASSID="3">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;</MailService>
+         <Rate>24.85</Rate>
+      </Postage>
+      <Postage CLASSID="2">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Hold For Pickup</MailService>
+         <Rate>24.85</Rate>
+      </Postage>
+      <Postage CLASSID="23">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Sunday/Holiday Delivery</MailService>
+         <Rate>37.35</Rate>
+      </Postage>
+      <Postage CLASSID="55">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Flat Rate Boxes</MailService>
+         <Rate>39.95</Rate>
+      </Postage>
+      <Postage CLASSID="56">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Flat Rate Boxes Hold For Pickup</MailService>
+         <Rate>39.95</Rate>
+      </Postage>
+      <Postage CLASSID="57">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Sunday/Holiday Delivery Flat Rate Boxes</MailService>
+         <Rate>52.45</Rate>
+      </Postage>
+      <Postage CLASSID="13">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Flat Rate Envelope</MailService>
+         <Rate>19.95</Rate>
+      </Postage>
+      <Postage CLASSID="27">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Flat Rate Envelope Hold For Pickup</MailService>
+         <Rate>19.95</Rate>
+      </Postage>
+      <Postage CLASSID="25">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Sunday/Holiday Delivery Flat Rate Envelope</MailService>
+         <Rate>32.45</Rate>
+      </Postage>
+      <Postage CLASSID="30">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Legal Flat Rate Envelope</MailService>
+         <Rate>19.95</Rate>
+      </Postage>
+      <Postage CLASSID="31">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Legal Flat Rate Envelope Hold For Pickup</MailService>
+         <Rate>19.95</Rate>
+      </Postage>
+      <Postage CLASSID="32">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Sunday/Holiday Delivery Legal Flat Rate Envelope</MailService>
+         <Rate>32.45</Rate>
+      </Postage>
+      <Postage CLASSID="62">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Padded Flat Rate Envelope</MailService>
+         <Rate>19.95</Rate>
+      </Postage>
+      <Postage CLASSID="63">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Padded Flat Rate Envelope Hold For Pickup</MailService>
+         <Rate>19.95</Rate>
+      </Postage>
+      <Postage CLASSID="64">
+         <MailService>Priority Mail Express 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Sunday/Holiday Delivery Padded Flat Rate Envelope</MailService>
+         <Rate>32.45</Rate>
+      </Postage>
+      <Postage CLASSID="1">
+         <MailService>Priority Mail 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;</MailService>
+         <Rate>8.85</Rate>
+      </Postage>
+      <Postage CLASSID="22">
+         <MailService>Priority Mail 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Large Flat Rate Box</MailService>
+         <Rate>16.85</Rate>
+      </Postage>
+      <Postage CLASSID="17">
+         <MailService>Priority Mail 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Medium Flat Rate Box</MailService>
+         <Rate>12.35</Rate>
+      </Postage>
+      <Postage CLASSID="28">
+         <MailService>Priority Mail 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Small Flat Rate Box</MailService>
+         <Rate>5.80</Rate>
+      </Postage>
+      <Postage CLASSID="16">
+         <MailService>Priority Mail 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Flat Rate Envelope</MailService>
+         <Rate>5.60</Rate>
+      </Postage>
+      <Postage CLASSID="44">
+         <MailService>Priority Mail 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Legal Flat Rate Envelope</MailService>
+         <Rate>5.75</Rate>
+      </Postage>
+      <Postage CLASSID="29">
+         <MailService>Priority Mail 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Padded Flat Rate Envelope</MailService>
+         <Rate>5.95</Rate>
+      </Postage>
+      <Postage CLASSID="38">
+         <MailService>Priority Mail 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Gift Card Flat Rate Envelope</MailService>
+         <Rate>5.60</Rate>
+      </Postage>
+      <Postage CLASSID="42">
+         <MailService>Priority Mail 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Small Flat Rate Envelope</MailService>
+         <Rate>5.60</Rate>
+      </Postage>
+      <Postage CLASSID="40">
+         <MailService>Priority Mail 1-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;
+         Window Flat Rate Envelope</MailService>
+         <Rate>5.60</Rate>
+      </Postage>
+      <Postage CLASSID="4">
+         <MailService>Standard Post&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt;</MailService>
+         <Rate>8.85</Rate>
+      </Postage>
+      <Postage CLASSID="6">
+         <MailService>Media Mail&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt;</MailService>
+         <Rate>4.33</Rate>
+      </Postage>
+      <Postage CLASSID="7">
+         <MailService>Library Mail</MailService>
+         <Rate>4.12</Rate>
+      </Postage>
+   </Package>
+</RateV4Response>
\ No newline at end of file
diff --git a/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/success_usps_response_return_shipment.xml b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/success_usps_response_return_shipment.xml
new file mode 100644
index 0000000000000000000000000000000000000000..d4ed264a289ace4b88f8eea9003007e8fe2c6dd3
--- /dev/null
+++ b/dev/tests/unit/testsuite/Magento/Usa/Model/Shipping/Carrier/_files/success_usps_response_return_shipment.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0)
+ * that is bundled with this package in the file LICENSE_AFL.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/afl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
+ */
+-->
+<SigConfirmCertifyV3.0Response>
+   <SignatureConfirmationNumber>420945389449301699320000105074</SignatureConfirmationNumber>
+   <SignatureConfirmationLabel>JVBERi0xLjINCjUgMCBvYmoNCjw8DQovVHlwZSAvWE9iamVjdA0KL1N1YnR</SignatureConfirmationLabel>
+   <ToName>D K</ToName>
+   <ToFirm>ASDAS</ToFirm>
+   <ToAddress1>43514 Christy Street</ToAddress1>
+   <ToAddress2>43514 CHRISTY ST</ToAddress2>
+   <ToCity>FREMONT</ToCity>
+   <ToState>CA</ToState>
+   <ToZip5>94538</ToZip5>
+   <ToZip4>3294</ToZip4>
+   <Postnet>94538329414</Postnet>
+</SigConfirmCertifyV3.0Response>
\ No newline at end of file
diff --git a/dev/tests/unit/testsuite/Magento/View/FileSystemTest.php b/dev/tests/unit/testsuite/Magento/View/FileSystemTest.php
index 6c51e6e7c97e3ac5bacfba21697bc57421775b8c..f80b39a8fc085b546b18c42cd5008e67a759858e 100644
--- a/dev/tests/unit/testsuite/Magento/View/FileSystemTest.php
+++ b/dev/tests/unit/testsuite/Magento/View/FileSystemTest.php
@@ -145,4 +145,37 @@ class FileSystemTest extends \PHPUnit_Framework_TestCase
         $actual = $this->_model->getViewFile($file, $params);
         $this->assertEquals($expected, $actual);
     }
+
+    /**
+     * @param string $path
+     * @param string $expectedResult
+     * @dataProvider normalizePathDataProvider
+     */
+    public function testNormalizePath($path, $expectedResult)
+    {
+        $result = $this->_model->normalizePath($path);
+        $this->assertEquals($expectedResult, $result);
+    }
+
+    public function normalizePathDataProvider()
+    {
+        return array(
+            'standard path' => array(
+                '/dir/somedir/somefile.ext',
+                '/dir/somedir/somefile.ext'
+            ),
+            'one dot path' => array(
+                '/dir/somedir/./somefile.ext',
+                '/dir/somedir/somefile.ext',
+            ),
+            'two dots path' => array(
+                '/dir/somedir/../somefile.ext',
+                '/dir/somefile.ext',
+            ),
+            'two times two dots path' => array(
+                '/dir/../somedir/../somefile.ext',
+                '/somefile.ext',
+            ),
+        );
+    }
 }
diff --git a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/BaseTest.php b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/BaseTest.php
index acb19c9e3752c15d7c213995df812c14fd269152..5b2a3ccc4068c2d3a886321a26006a2520997c15 100644
--- a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/BaseTest.php
+++ b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/BaseTest.php
@@ -49,15 +49,23 @@ class BaseTest extends \PHPUnit_Framework_TestCase
     {
         $this->directory = $this->getMock(
             'Magento\Filesystem\Directory\Read',
-            array('getAbsolutePath', 'search'), array(), '', false
+            array(),
+            array(),
+            '',
+            false
         );
         $filesystem = $this->getMock(
-            'Magento\Filesystem', array('getDirectoryRead', '__wakeup'), array(), '', false
+            'Magento\Filesystem',
+            array('getDirectoryRead', '__wakeup'),
+            array(),
+            '',
+            false
         );
         $filesystem->expects($this->once())
             ->method('getDirectoryRead')
             ->with(\Magento\Filesystem::MODULES)
             ->will($this->returnValue($this->directory));
+
         $this->fileFactory = $this->getMock('Magento\View\Layout\File\Factory', array(), array(), '', false);
         $this->model = new Base($filesystem, $this->fileFactory);
     }
@@ -99,8 +107,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase
                 ->expects($this->at($key))
                 ->method('create')
                 ->with(sprintf($handlePath, $file['module'], $file['handle']), $moduleName)
-                ->will($this->returnValue($checkResult[$key]))
-            ;
+                ->will($this->returnValue($checkResult[$key]));
         }
 
         $this->assertSame($checkResult, $this->model->getFiles($theme, $filePath));
@@ -122,7 +129,7 @@ class BaseTest extends \PHPUnit_Framework_TestCase
             ),
             array(
                 array(
-                    array('handle' => 'preset/4', 'module' => 'Fourth'),
+                    array('handle' => 'preset/4', 'module' => 'Four'),
                 ),
                 'preset/4',
             ),
diff --git a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/ThemeTest.php b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/ThemeTest.php
index ca1eb089307d520512fcb134f091ba007ee6fe7e..2636d6b90f44feb81d8adf9687d25c41c575b455 100644
--- a/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/ThemeTest.php
+++ b/dev/tests/unit/testsuite/Magento/View/Layout/File/Source/Override/ThemeTest.php
@@ -44,12 +44,14 @@ class ThemeTest extends \PHPUnit_Framework_TestCase
     protected function setUp()
     {
         $filesystem = $this->getMock('Magento\Filesystem', array('getDirectoryRead'), array(), '', false);
-        $this->_directory = $this->getMock('Magento\Filesystem\Directory\Read', array('search'), array(), '', false);
+        $this->_directory = $this->getMock('Magento\Filesystem\Directory\Read', array(), array(), '', false);
+        $this->_directory->expects($this->any())
+            ->method('getAbsolutePath')
+            ->will($this->returnArgument(0));
 
         $filesystem->expects($this->any())->method('getDirectoryRead')
-            ->with(\Magento\Filesystem::THEMES)
+            ->with($this->equalTo(\Magento\Filesystem::THEMES))
             ->will($this->returnValue($this->_directory));
-
         $this->_fileFactory = $this->getMock('Magento\View\Layout\File\Factory', array(), array(), '', false);
         $this->_model = new \Magento\View\Layout\File\Source\Override\Theme(
             $filesystem, $this->_fileFactory
@@ -73,9 +75,8 @@ class ThemeTest extends \PHPUnit_Framework_TestCase
         $filePathTwo = 'design/area/theme_path/Module_Two/layout/override/theme/grand_parent_theme/2.xml';
         $this->_directory->expects($this->once())
             ->method('search')
-            ->with('~area\/theme_path\/[\S]+_[\S]+\/layout\/override\/theme\/[\S]+\/[\S]+\.xml~')
-            ->will($this->returnValue(array($filePathOne, $filePathTwo)))
-        ;
+            ->with($this->equalTo('area/theme_path/*_*/layout/override/theme/*/*.xml'))
+            ->will($this->returnValue(array($filePathOne, $filePathTwo)));
 
         $fileOne = new \Magento\View\Layout\File('1.xml', 'Module_One', $parentTheme);
         $fileTwo = new \Magento\View\Layout\File('2.xml', 'Module_Two', $grandparentTheme);
@@ -107,7 +108,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase
         $filePathOne = 'design/area/theme_path/Module_Two/layout/override/theme/grand_parent_theme/preset/3.xml';
         $this->_directory->expects($this->once())
             ->method('search')
-            ->with('~area\/theme_path\/[\S]+_[\S]+\/layout\/override\/theme\/[\S]+\/preset\/3\.xml~')
+            ->with('area/theme_path/*_*/layout/override/theme/*/preset/3.xml')
             ->will($this->returnValue(array($filePathOne)))
         ;
 
@@ -138,7 +139,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase
 
         $this->_directory->expects($this->once())
             ->method('search')
-            ->with('~area\/theme_path\/[\S]+_[\S]+\/layout\/override\/theme\/[\S]+\/[\S]+\.xml~')
+            ->with('area/theme_path/*_*/layout/override/theme/*/*.xml')
             ->will($this->returnValue(array($filePath)));
 
         $this->_model->getFiles($theme);
diff --git a/dev/tests/unit/testsuite/Magento/View/Url/CssResolverTest.php b/dev/tests/unit/testsuite/Magento/View/Url/CssResolverTest.php
index b2c506258bb6dfaf6e40d4c4baaad27eacfcb89d..e0a921ccd341c87009c4740f066c7c0255bd1df0 100644
--- a/dev/tests/unit/testsuite/Magento/View/Url/CssResolverTest.php
+++ b/dev/tests/unit/testsuite/Magento/View/Url/CssResolverTest.php
@@ -38,7 +38,76 @@ class CssResolverTest extends \PHPUnit_Framework_TestCase
             ->method('getPath')
             ->with(\Magento\Filesystem::ROOT)
             ->will($this->returnValue('/base_dir/'));
-        $this->object = new CssResolver($filesystem);
+        $viewFilesystem = $this->getMock('Magento\View\Filesystem', array('normalizePath'), array(), '', false);
+        $viewFilesystem->expects($this->any())
+            ->method('normalizePath')
+            ->will($this->returnValueMap(array(
+                array(
+                    '/does/not/matter.css',
+                    '/does/not/matter.css'
+                ),
+                array(
+                    '/base_dir/pub/assets/new/location/any_new_name.css',
+                    '/base_dir/pub/assets/new/location/any_new_name.css'
+                ),
+                array(
+                    '/base_dir\pub/assets\new/location/any_new_name.css',
+                    '/base_dir\pub/assets\new/location/any_new_name.css'
+                ),
+                array(
+                    '/base_dir/pub/assets/referenced/di/any_new_name.css',
+                    '/base_dir/pub/assets/referenced/di/any_new_name.css'
+                ),
+                array(
+                    '/base_dir/pub/any_new_name.css',
+                    '/base_dir/pub/any_new_name.css'
+                ),
+                array(
+                    '/not/base_dir/pub/new/file.css',
+                    '/not/base_dir/pub/new/file.css'
+                ),
+                array(
+                    '/base_dir/pub/css/file.css',
+                    '/base_dir/pub/css/file.css'
+                ),
+                array(
+                    '/not/base_dir/pub/css/file.css',
+                    '/not/base_dir/pub/css/file.css'
+                ),
+                array(
+                    '/base_dir/pub/new/file.css',
+                    '/base_dir/pub/new/file.css'
+                ),
+                array(
+                    '/base_dir/pub/assets/referenced/dir/../images/h2.gif',
+                    '/base_dir/pub/assets/referenced/images/h2.gif'
+                ),
+                array(
+                    '/base_dir/pub/assets/referenced/dir/Magento_Theme::favicon.ico',
+                    '/base_dir/pub/assets/referenced/dir/Magento_Theme::favicon.ico'
+                ),
+                array(
+                    '/base_dir/pub/assets/referenced/dir/original.css',
+                    '/base_dir/pub/assets/referenced/dir/original.css'
+                ),
+                array(
+                    '/base_dir/pub/assets/referenced/dir/body.gif',
+                    '/base_dir/pub/assets/referenced/dir/body.gif'
+                ),
+                array(
+                    '/base_dir/pub/dir/body.gif',
+                    '/base_dir/pub/dir/body.gif'
+                ),
+                array(
+                    '/base_dir/pub/css/body.gif',
+                    '/base_dir/pub/css/body.gif'
+                ),
+                array(
+                    '/not/base_dir/pub/css/body.gif',
+                    '/not/base_dir/pub/css/body.gif'
+                )
+            )));
+        $this->object = new CssResolver($filesystem, $viewFilesystem);
     }
 
     /**
@@ -61,12 +130,6 @@ class CssResolverTest extends \PHPUnit_Framework_TestCase
         $callback = function ($relativeUrl) {
             return '/base_dir/pub/assets/referenced/dir/' . $relativeUrl;
         };
-        $callbackWindows = function ($relativeUrl) {
-            return '/base_dir/pub\assets/referenced\dir/' . $relativeUrl;
-        };
-        $callbackByOrigPath = function ($relativeUrl, $originalPath) {
-            return dirname($originalPath) . '/' . $relativeUrl;
-        };
 
         $object = new \Magento\Object(array('resolved_path' => array('body.gif' => '/base_dir/pub/dir/body.gif')));
         $objectCallback = array($object, 'getResolvedPath');
@@ -89,27 +152,6 @@ class CssResolverTest extends \PHPUnit_Framework_TestCase
                 $callback,
                 $result,
             ),
-            'back slashes in referenced name' => array(
-                $source,
-                '/does/not/matter.css',
-                '/base_dir/pub/assets/new/location/any_new_name.css',
-                $callbackWindows,
-                $result,
-            ),
-            'same directory' => array(
-                $source,
-                '/does/not/matter.css',
-                '/base_dir/pub/assets/referenced/dir/any_new_name.css',
-                $callback,
-                $source,
-            ),
-            'directory with superset name' => array(
-                'body {background: url(body.gif);}',
-                '/base_dir/pub/assets/referenced/dir/original.css',
-                '/base_dir/pub/assets/referenced/dirname/any_new_name.css',
-                null,
-                'body {background: url(../dir/body.gif);}',
-            ),
             'directory with subset name' => array(
                 'body {background: url(body.gif);}',
                 '/base_dir/pub/assets/referenced/dir/original.css',
@@ -124,20 +166,6 @@ class CssResolverTest extends \PHPUnit_Framework_TestCase
                 $objectCallback,
                 'body {background: url(dir/body.gif);}',
             ),
-            'default resolution without a callback' => array(
-                'body {background: url(../body.gif);}',
-                '/base_dir/pub/original/subdir/original_name.css',
-                '/base_dir/pub/new/subdir/any_new_name.css',
-                null,
-                'body {background: url(../../original/body.gif);}',
-            ),
-            'callback must receive original path' => array(
-                'body {background: url(../body.gif);}',
-                '/base_dir/pub/original/subdir/original_name.css',
-                '/base_dir/pub/new/subdir/any_new_name.css',
-                $callbackByOrigPath,
-                'body {background: url(../../original/body.gif);}',
-            ),
         );
     }
 
diff --git a/dev/tests/unit/testsuite/Magento/View/Url/_files/result.css b/dev/tests/unit/testsuite/Magento/View/Url/_files/result.css
index 83bdd9999df33d1e5836848de102fd888b38ce99..14714dc844d35c24ced23af3014ca1547cdfa0b7 100644
--- a/dev/tests/unit/testsuite/Magento/View/Url/_files/result.css
+++ b/dev/tests/unit/testsuite/Magento/View/Url/_files/result.css
@@ -20,16 +20,7 @@
  * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
  * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
  */
-@import url(../../referenced/recursive.css);
-@import url("../../referenced/dir/deep/recursive.css");
-body {background: url(../../referenced/dir/body.gif);}
-p {background: url(../../referenced/dir/1.gif?param);}
-h1 {background: url('../../referenced/h1.gif#param');} h2 {background: url(../../referenced/images/h2.gif?test);}
+h2 {background: url(../../referenced/images/h2.gif?test);}
 a {background: url(data:image/png;)}
-
-ul {background: url(/absolute.gif);}
-ol {background: url(http://example.com/absolute.gif);}
 li {background: url("https://example.com/absolute.gif");}
-
-ol.valid {background: url(../../referenced/dir/Namespace_Module::absolute_valid_module.gif)} /* theme file modular */
 ol.favicon {background: url(../../referenced/dir/Magento_Theme::favicon.ico)} /* base file */
diff --git a/dev/tests/unit/testsuite/Magento/View/Url/_files/source.css b/dev/tests/unit/testsuite/Magento/View/Url/_files/source.css
index 37ef8fe81705a8accab5e54f8b5f92fa2ed5e43b..103ced3a7f2914708e7fc9fee4cb8d855813d351 100644
--- a/dev/tests/unit/testsuite/Magento/View/Url/_files/source.css
+++ b/dev/tests/unit/testsuite/Magento/View/Url/_files/source.css
@@ -20,16 +20,7 @@
  * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
  * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
  */
-@import url(../recursive.css);
-@import url("deep/recursive.css");
-body {background: url(body.gif);}
-p {background: url(1.gif?param);}
-h1 {background: url('../h1.gif#param');} h2 {background: url(../images/h2.gif?test);}
+h2 {background: url(../images/h2.gif?test);}
 a {background: url(data:image/png;)}
-
-ul {background: url(/absolute.gif);}
-ol {background: url(http://example.com/absolute.gif);}
 li {background: url("https://example.com/absolute.gif");}
-
-ol.valid {background: url(Namespace_Module::absolute_valid_module.gif)} /* theme file modular */
 ol.favicon {background: url(Magento_Theme::favicon.ico)} /* base file */
diff --git a/dev/tests/unit/testsuite/Magento/View/UrlTest.php b/dev/tests/unit/testsuite/Magento/View/UrlTest.php
index 974bb50f1ba623fb8ea64403ce2835bd8558e6cc..21ec47249c003d21ad61bd59f2d00573e0fcc00d 100644
--- a/dev/tests/unit/testsuite/Magento/View/UrlTest.php
+++ b/dev/tests/unit/testsuite/Magento/View/UrlTest.php
@@ -94,6 +94,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase
         $dFManager = $this->getMock('Magento\View\DeployedFilesManager', array(), array(), '',
             false
         );
+        $viewFilesystem = $this->getMock('Magento\View\Filesystem', array(), array(), '', false);
 
         // 8. Get default fake url map
         $urlMap = array('fake' => array('key' => "some_key", 'value' => "some_value"));
@@ -101,7 +102,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase
         // Create model to be tested
         /** @var $model \Magento\View\Url|\PHPUnit_Framework_MockObject_MockObject */
         $model = new \Magento\View\Url(
-            $filesystem, $urlBuilder, $urlConfig, $viewService, $publisher, $dFManager, $urlMap
+            $filesystem, $urlBuilder, $urlConfig, $viewService, $publisher, $dFManager, $viewFilesystem, $urlMap
         );
 
         // Test
diff --git a/dev/tools/Magento/Tools/View/Generator/CopyRule.php b/dev/tools/Magento/Tools/View/Generator/CopyRule.php
index 9f65333cab0f10aa15414ffc30e3c663298f694a..968bfa52562aee2ab3a5f94043f90c41873bc703 100644
--- a/dev/tools/Magento/Tools/View/Generator/CopyRule.php
+++ b/dev/tools/Magento/Tools/View/Generator/CopyRule.php
@@ -151,18 +151,8 @@ class CopyRule
             $firstPlaceholderPos = strpos($dirPattern, '*');
             $patternBaseDir = substr($dirPattern, 0, $firstPlaceholderPos);
             $patternTrailing = substr($dirPattern, $firstPlaceholderPos);
-            $patternTrailing = preg_replace_callback('/[\\\\^$.[\\]|()?*+{}\\-\\/]/', function ($matches) {
-                switch ($matches[0]) {
-                    case '*':
-                        return '.*';
-                    case '?':
-                        return '.';
-                    default:
-                        return '\\'.$matches[0];
-                }
-            }, $patternTrailing, -1);
 
-            $paths = $directoryHandler->search('#' . $patternTrailing . '#', $patternBaseDir);
+            $paths = $directoryHandler->search($patternTrailing, $patternBaseDir);
         } else {
             // pattern is already a valid path containing no placeholders
             $paths = array($dirPattern);
diff --git a/dev/tools/Magento/Tools/View/generator.php b/dev/tools/Magento/Tools/View/generator.php
index 24fdedbefd0b4e92d246b6017db801ccc8785304..5f5a99186236cf85f17c8ebd4b65f3f94cc1186a 100644
--- a/dev/tools/Magento/Tools/View/generator.php
+++ b/dev/tools/Magento/Tools/View/generator.php
@@ -62,32 +62,29 @@ if (isset($options['help'])) {
 
 $logger->log('Deploying...', \Zend_Log::INFO);
 try {
-    $objectManager = new \Magento\ObjectManager\ObjectManager();
-    $entityFactory = new Magento\Core\Model\EntityFactory($objectManager);
-    $filesystem = $entityFactory->create('Magento\Filesystem', array(
-        'directoryList' => new \Magento\Filesystem\DirectoryList(BP)
-    ));
-    $config = new \Magento\Tools\View\Generator\Config($filesystem, $options);
-    $fileIteratorFactory = new \Magento\Config\FileIteratorFactory();
-    $themes = new \Magento\Core\Model\Theme\Collection($entityFactory, $filesystem, $fileIteratorFactory);
-    $themes->setItemObjectClass('\Magento\Tools\View\Generator\ThemeLight');
-    $themes->addDefaultPattern('*');
 
-    $fallbackFactory = new \Magento\View\Design\Fallback\Factory($filesystem);
-    $generator = new \Magento\Tools\View\Generator\CopyRule($filesystem, $themes,
-        $fallbackFactory->createViewFileRule());
+    $objectManagerFactory = new \Magento\App\ObjectManagerFactory();
+    $objectManager = $objectManagerFactory->create(BP, $_SERVER);
+
+    $config = $objectManager->create('Magento\Tools\View\Generator\Config', array('cmdOptions' => $options));
+    $themes = $objectManager->create('Magento\Core\Model\Theme\Collection');
+    $themes->setItemObjectClass('Magento\Tools\View\Generator\ThemeLight');
+    $themes->addDefaultPattern('*');
+    $fallbackFactory = $objectManager->create('Magento\View\Design\Fallback\Factory');
+    $generator = $objectManager->create('Magento\Tools\View\Generator\CopyRule', array(
+            'themes' => $themes,
+            'fallbackRule' => $fallbackFactory->createViewFileRule()
+        ));
     $copyRules = $generator->getCopyRules();
-    $cssUrlResolver = new \Magento\View\Url\CssResolver($filesystem);
-    $deployment = new \Magento\Tools\View\Generator\ThemeDeployment(
-        $cssUrlResolver,
-        $config->getDestinationDir(),
-        __DIR__ . '/config/permitted.php',
-        __DIR__ . '/config/forbidden.php',
-        $config->isDryRun()
-    );
+    $deployment = $objectManager->create('Magento\Tools\View\Generator\ThemeDeployment', array(
+            'destinationHomeDir' => $config->getDestinationDir(),
+            'configPermitted' => __DIR__ . '/config/permitted.php',
+            'configForbidden' => __DIR__ . '/config/forbidden.php',
+            'isDryRun' => $config->isDryRun()
+        ));
     $deployment->run($copyRules);
 } catch (\Exception $e) {
     $logger->log('Error: ' . $e->getMessage(), \Zend_Log::ERR);
     exit(1);
 }
-$logger->log('Completed successfully.', \Zend_Log::INFO);
+$logger->log('Completed successfully.', \Zend_Log::INFO);
\ No newline at end of file
diff --git a/lib/Magento/App/Config/FileResolver/Primary.php b/lib/Magento/App/Config/FileResolver/Primary.php
index 1c8d7520ed856aefa8c07b5d38a0cd32442cf89f..72f588eae92dffb9b10717f70fb7cc2eddbd9df1 100644
--- a/lib/Magento/App/Config/FileResolver/Primary.php
+++ b/lib/Magento/App/Config/FileResolver/Primary.php
@@ -65,7 +65,8 @@ class Primary implements \Magento\Config\FileResolverInterface
     public function get($filename, $scope)
     {
         return $this->iteratorFactory->create(
-            $this->configDirectory, $this->configDirectory->search('#' . preg_quote($filename) . '$#')
+            $this->configDirectory,
+            $this->configDirectory->search('{*' . $filename . ',*/*' . $filename . '}')
         );
     }
 }
diff --git a/lib/Magento/App/ObjectManager/ConfigLoader/Primary.php b/lib/Magento/App/ObjectManager/ConfigLoader/Primary.php
index 503f1d890bebd594779ce1ad944b0a883b986401..d29bb043e4b0ca76dbd7142cd6073eb506490392 100644
--- a/lib/Magento/App/ObjectManager/ConfigLoader/Primary.php
+++ b/lib/Magento/App/ObjectManager/ConfigLoader/Primary.php
@@ -19,7 +19,7 @@
  * Do not edit or add to this file if you wish to upgrade Magento to newer
  * versions in the future. If you wish to customize Magento for your
  * needs please refer to http://www.magentocommerce.com for more information.
- * 
+ *
  * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
  * @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
  */
@@ -35,19 +35,19 @@ class Primary
     protected $_appMode;
 
     /**
-     * @var string
+     * @var \Magento\Filesystem\DirectoryList
      */
-    protected $_configDirectoryPath;
+    protected $_directoryList;
 
     /**
      * @param string $configDirectoryPath
      * @param string $appMode
      */
     public function __construct(
-        $configDirectoryPath,
+        \Magento\Filesystem\DirectoryList $directoryList,
         $appMode = \Magento\App\State::MODE_DEFAULT
     ) {
-        $this->_configDirectoryPath = $configDirectoryPath;
+        $this->_directoryList = $directoryList;
         $this->_appMode = $appMode;
     }
 
@@ -61,7 +61,7 @@ class Primary
         $reader = new \Magento\ObjectManager\Config\Reader\Dom(
             new \Magento\App\Config\FileResolver\Primary(
                 new \Magento\Filesystem(
-                    new \Magento\Filesystem\DirectoryList($this->_configDirectoryPath),
+                    $this->_directoryList,
                     new \Magento\Filesystem\Directory\ReadFactory(),
                     new \Magento\Filesystem\Directory\WriteFactory()
                 ),
diff --git a/lib/Magento/App/ObjectManagerFactory.php b/lib/Magento/App/ObjectManagerFactory.php
index 9f8b89a46908843396c9b8f5bbb948e22ac54fdf..6478a4d7ed1fddd5f9cbc9bc2ed8f3d2ce6d1013 100644
--- a/lib/Magento/App/ObjectManagerFactory.php
+++ b/lib/Magento/App/ObjectManagerFactory.php
@@ -97,7 +97,7 @@ class ObjectManagerFactory
         $diConfig = new $configClass($relations, $definitions);
         $appMode = $options->get(State::PARAM_MODE, State::MODE_DEFAULT);
 
-        $configData = $this->_loadPrimaryConfig($directories->getDir(\Magento\Filesystem::ROOT), $appMode);
+        $configData = $this->_loadPrimaryConfig($directories, $appMode);
 
         if ($configData) {
             $diConfig->extend($configData);
@@ -153,15 +153,15 @@ class ObjectManagerFactory
     /**
      * Load primary config data
      *
-     * @param string $configDirectoryPath
+     * @param \Magento\Filesystem\DirectoryList $directoryList
      * @param string $appMode
      * @return array
      * @throws \Magento\BootstrapException
      */
-    protected function _loadPrimaryConfig($configDirectoryPath, $appMode)
+    protected function _loadPrimaryConfig($directoryList, $appMode)
     {
         $configData = null;
-        $primaryLoader = new \Magento\App\ObjectManager\ConfigLoader\Primary($configDirectoryPath, $appMode);
+        $primaryLoader = new \Magento\App\ObjectManager\ConfigLoader\Primary($directoryList, $appMode);
         try {
             $configData = $primaryLoader->load();
         } catch (\Exception $e) {
diff --git a/lib/Magento/App/Response/Http/FileFactory.php b/lib/Magento/App/Response/Http/FileFactory.php
index 480bb31a43c2004e1d33c683d3531df47822f298..d96c1456f8064b05d5722d10710589a5fc942276 100644
--- a/lib/Magento/App/Response/Http/FileFactory.php
+++ b/lib/Magento/App/Response/Http/FileFactory.php
@@ -67,7 +67,7 @@ class FileFactory
      */
     public function create($fileName, $content, $contentType = 'application/octet-stream', $contentLength = null)
     {
-        $filesystem = $this->_filesystem;
+        $dir = $this->_filesystem->getDirectoryWrite(\Magento\Filesystem::VAR_DIR);
         $isFile = false;
         $file = null;
         if (is_array($content)) {
@@ -77,7 +77,7 @@ class FileFactory
             if ($content['type'] == 'filename') {
                 $isFile = true;
                 $file = $content['value'];
-                $contentLength = $filesystem->getFileSize($file);
+                $contentLength = $dir->stat($file)['size'];
             }
         }
 
@@ -91,24 +91,22 @@ class FileFactory
 
         if (!is_null($content)) {
             if ($isFile) {
-                $this->_response->clearBody();
-                $this->_response->sendHeaders();
-
-                if (!$filesystem->isFile($file)) {
+                if (!$dir->isFile($file)) {
                     throw new \Exception(__('File not found'));
                 }
-                $stream = $filesystem->fileOpen($file, 'r');
-                while ($buffer = $filesystem->fileRead($stream, 1024)) {
-                    print $buffer;
+                $this->_response->sendHeaders();
+                $stream = $dir->openFile($file, 'r');
+                while (!$stream->eof()) {
+                    echo $stream->read(1024);
                 }
+                $stream->close();
                 flush();
-                $filesystem->fileClose($stream);
                 if (!empty($content['rm'])) {
-                    $filesystem->deleteFile($file);
+                    $dir->delete($file);
                 }
-
                 exit(0);
             } else {
+                $this->_response->clearBody();
                 $this->_response->setBody($content);
             }
         }
diff --git a/lib/Magento/Data/Form/Element/AbstractElement.php b/lib/Magento/Data/Form/Element/AbstractElement.php
index 550dfc94847118b45a6eb94b9f29be82fb3f6fcd..8141d5225f30ec704a73e2a4ba4ddf519f160f6e 100644
--- a/lib/Magento/Data/Form/Element/AbstractElement.php
+++ b/lib/Magento/Data/Form/Element/AbstractElement.php
@@ -236,14 +236,17 @@ abstract class AbstractElement extends \Magento\Data\Form\AbstractForm
     public function getElementHtml()
     {
         $html = '';
-        if ($this->getBeforeElementHtml()) {
+        if ($this->getBeforeElementHtml() && $this->getBeforeElementHtml() != '') {
             $html .= '<label class="addbefore" for="' . $this->getHtmlId() . '">' . $this->getBeforeElementHtml() . '</label>';
         }
         $html .= '<input id="' . $this->getHtmlId() . '" name="' . $this->getName() . '" '
             . $this->_getUiId()
             . ' value="' . $this->getEscapedValue() . '" ' . $this->serialize($this->getHtmlAttributes()) . '/>';
-        if ($this->getAfterElementHtml()) {
-            $html.= '<label class="addafter" for="' . $this->getHtmlId() . '">' . $this->getAfterElementHtml() . '</label>';
+        if ($this->getAfterElementJs() && $this->getAfterElementJs() != '') {
+            $html .= $this->getAfterElementJs();
+        }
+        if ($this->getAfterElementHtml() && $this->getAfterElementHtml() != '') {
+            $html .= '<label class="addafter" for="' . $this->getHtmlId() . '">' . $this->getAfterElementHtml() . '</label>';
         }
         return $html;
     }
@@ -258,6 +261,11 @@ abstract class AbstractElement extends \Magento\Data\Form\AbstractForm
         return $this->getData('after_element_html');
     }
 
+    public function getAfterElementJs()
+    {
+        return $this->getData('after_element_js');
+    }
+
     /**
      * Render HTML for element's label
      *
diff --git a/lib/Magento/Filesystem/Directory/Read.php b/lib/Magento/Filesystem/Directory/Read.php
index debaafdec96151e235d44306f68e4d034957614d..7ac8447a8375ab181c2e82698dd4be453acc0ca8 100644
--- a/lib/Magento/Filesystem/Directory/Read.php
+++ b/lib/Magento/Filesystem/Directory/Read.php
@@ -114,21 +114,6 @@ class Read implements ReadInterface
     {
         return $this->driver->getRelativePath($this->path, $path);
     }
-    /**
-     * Validate of path existence
-     *
-     * @param string $path
-     * @return bool
-     * @throws \Magento\Filesystem\FilesystemException
-     */
-    protected function assertExist($path)
-    {
-        $absolutePath = $this->driver->getAbsolutePath($this->path, $path);
-        if ($this->driver->isExists($absolutePath) === false) {
-            throw new FilesystemException(sprintf('The path "%s" doesn\'t exist', $absolutePath));
-        }
-        return true;
-    }
 
     /**
      * Retrieve list of all entities in given path
@@ -138,16 +123,11 @@ class Read implements ReadInterface
      */
     public function read($path = null)
     {
-        $this->assertExist($path);
-
-        $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS;
-        $iterator = new \FilesystemIterator($this->driver->getAbsolutePath($this->path, $path), $flags);
+        $files = $this->driver->readDirectory($this->driver->getAbsolutePath($this->path, $path));
         $result = array();
-        /** @var \FilesystemIterator $file */
-        foreach ($iterator as $file) {
-            $result[] = $this->getRelativePath($file->getPathname());
+        foreach ($files as $file) {
+            $result[] = $this->getRelativePath($file);
         }
-        sort($result);
         return $result;
     }
 
@@ -160,26 +140,17 @@ class Read implements ReadInterface
      */
     public function search($pattern, $path = null)
     {
-        clearstatcache();
         if ($path) {
             $absolutePath = $this->driver->getAbsolutePath($this->path, $this->getRelativePath($path));
         } else {
             $absolutePath = $this->path;
         }
 
-        $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS;
-        $iterator = new \RegexIterator(
-            new \RecursiveIteratorIterator(
-                new \RecursiveDirectoryIterator($absolutePath, $flags), \RecursiveIteratorIterator::CHILD_FIRST
-            ),
-            $pattern
-        );
+        $files = $this->driver->search($pattern, $absolutePath);
         $result = array();
-        /** @var \FilesystemIterator $file */
-        foreach ($iterator as $file) {
-            $result[] = $this->getRelativePath($file->getPathname());
+        foreach ($files as $file) {
+            $result[] = $this->getRelativePath($file);
         }
-        sort($result);
         return $result;
     }
 
@@ -204,7 +175,6 @@ class Read implements ReadInterface
      */
     public function stat($path)
     {
-        $this->assertExist($path);
         return $this->driver->stat($this->driver->getAbsolutePath($this->path, $path));
     }
 
diff --git a/lib/Magento/Filesystem/Directory/ReadInterface.php b/lib/Magento/Filesystem/Directory/ReadInterface.php
index 893f137718c4e613ed0bb16d7d4efa1d4af42206..81aa6e68000d66f4b42754cf9ab08474dbb91078 100644
--- a/lib/Magento/Filesystem/Directory/ReadInterface.php
+++ b/lib/Magento/Filesystem/Directory/ReadInterface.php
@@ -53,9 +53,10 @@ interface ReadInterface
      * Search all entries for given regex pattern
      *
      * @param string $pattern
+     * @param string $path [optional]
      * @return array
      */
-    public function search($pattern);
+    public function search($pattern, $path = null);
 
     /**
      * Check a file or directory exists
diff --git a/lib/Magento/Filesystem/Directory/Write.php b/lib/Magento/Filesystem/Directory/Write.php
index bd176cd29bfaf1f0ee3f3beb7db24fe0f6e4e8ee..77055cbcae556f92ec09ce9b12aa4ff00854e17a 100644
--- a/lib/Magento/Filesystem/Directory/Write.php
+++ b/lib/Magento/Filesystem/Directory/Write.php
@@ -210,7 +210,6 @@ class Write extends Read implements WriteInterface
      */
     public function changePermissions($path, $permissions)
     {
-        $this->assertExist($path);
         $absolutePath = $this->driver->getAbsolutePath($this->path, $path);
         return $this->driver->changePermissions($absolutePath, $permissions);
     }
diff --git a/lib/Magento/Filesystem/Driver/File.php b/lib/Magento/Filesystem/Driver/File.php
index a112896d8e5e2e2f6fbe7939ae4e46e4fdd18e7d..e9ac61e0deed3d605e9347957113b83c905c2bd0 100644
--- a/lib/Magento/Filesystem/Driver/File.php
+++ b/lib/Magento/Filesystem/Driver/File.php
@@ -222,6 +222,55 @@ class File implements \Magento\Filesystem\DriverInterface
         return $result;
     }
 
+    /**
+     * Read directory
+     *
+     * @param string $path
+     * @return array
+     * @throws FilesystemException
+     */
+    public function readDirectory($path)
+    {
+        try {
+            $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS;
+            $iterator = new \FilesystemIterator($path, $flags);
+            $result = array();
+            /** @var \FilesystemIterator $file */
+            foreach ($iterator as $file) {
+                $result[] = $file->getPathname();
+            }
+            sort($result);
+            return $result;
+        } catch (\Exception $e) {
+            throw new FilesystemException($e->getMessage(), $e->getCode(), $e);
+        }
+    }
+
+    /**
+     * Search paths by given regex
+     *
+     * @param string $pattern
+     * @param string $path
+     * @return array
+     * @throws FilesystemException
+     */
+    public function search($pattern, $path)
+    {
+        clearstatcache();
+        $globPattern = rtrim($path, '/') . '/' . ltrim($pattern, '/');
+        $result = @glob($globPattern, GLOB_BRACE);
+        if ($result === false) {
+            throw new FilesystemException(
+                sprintf('The "%s" pattern cannot be processed in "%s" path %s',
+                    $pattern,
+                    $path,
+                    $this->getWarningMessage()
+                ));
+        }
+        return $result;
+    }
+
+
     /**
      * Renames a file or directory
      *
diff --git a/lib/Magento/Filesystem/DriverInterface.php b/lib/Magento/Filesystem/DriverInterface.php
index b594c25cadd95067a7ac844a64efcdab82cc8676..35c6b91932ca018a33d1b7e13d217a9355281af8 100644
--- a/lib/Magento/Filesystem/DriverInterface.php
+++ b/lib/Magento/Filesystem/DriverInterface.php
@@ -113,6 +113,25 @@ interface DriverInterface
      */
     public function createDirectory($path, $permissions);
 
+    /**
+     * Read directory
+     *
+     * @param string $path
+     * @return array
+     * @throws FilesystemException
+     */
+    public function readDirectory($path);
+
+    /**
+     * Search paths by given regex
+     *
+     * @param string $pattern
+     * @param string $path
+     * @return array
+     * @throws FilesystemException
+     */
+    public function search($pattern, $path);
+
     /**
      * Renames a file or directory
      *
diff --git a/lib/Magento/Module/Declaration/FileResolver.php b/lib/Magento/Module/Declaration/FileResolver.php
index f3342b586d2ef957df7e08e4276e8e16321c5136..4d6071db046004baadb8681e533de3c1d89bd069 100644
--- a/lib/Magento/Module/Declaration/FileResolver.php
+++ b/lib/Magento/Module/Declaration/FileResolver.php
@@ -32,21 +32,21 @@ class FileResolver implements \Magento\Config\FileResolverInterface
      *
      * @var \Magento\Filesystem\Directory\ReadInterface
      */
-    protected $directoryReadModule;
+    protected $modulesDirectory;
 
     /**
      * Config directory with read access
      *
      * @var \Magento\Filesystem\Directory\ReadInterface
      */
-    protected $directoryReadConfig;
+    protected $configDirectory;
 
     /**
      * Root directory with read access
      *
      * @var \Magento\Filesystem\Directory\ReadInterface
      */
-    protected $directoryReadRoot;
+    protected $rootDirectory;
 
     /**
      * File iterator factory
@@ -64,9 +64,9 @@ class FileResolver implements \Magento\Config\FileResolverInterface
         \Magento\Config\FileIteratorFactory $iteratorFactory
     ) {
         $this->iteratorFactory      = $iteratorFactory;
-        $this->directoryReadModules = $filesystem->getDirectoryRead(\Magento\Filesystem::MODULES);
-        $this->directoryReadConfig  = $filesystem->getDirectoryRead(\Magento\Filesystem::CONFIG);
-        $this->directoryReadRoot     = $filesystem->getDirectoryRead(\Magento\Filesystem::ROOT);
+        $this->modulesDirectory = $filesystem->getDirectoryRead(\Magento\Filesystem::MODULES);
+        $this->configDirectory  = $filesystem->getDirectoryRead(\Magento\Filesystem::CONFIG);
+        $this->rootDirectory     = $filesystem->getDirectoryRead(\Magento\Filesystem::ROOT);
     }
 
     /**
@@ -75,28 +75,26 @@ class FileResolver implements \Magento\Config\FileResolverInterface
      */
     public function get($filename, $scope)
     {
-        $appCodeDir =  $this->directoryReadRoot->getRelativePath(
-            $this->directoryReadModules->getAbsolutePath()
-        );
-        $configDir =  $this->directoryReadRoot->getRelativePath(
-            $this->directoryReadConfig->getAbsolutePath()
-        );
-        $moduleFileList = $this->directoryReadRoot->search('#.*?/module.xml$#', $appCodeDir);
+        $moduleDir = $this->modulesDirectory->getAbsolutePath();
+        $configDir =  $this->configDirectory->getAbsolutePath();
 
-        $mageScopePath = $appCodeDir . '/Magento/';
+        $mageScopePath = $moduleDir . '/Magento';
         $output = array(
             'base' => array(),
             'mage' => array(),
             'custom' => array(),
         );
-        foreach ($moduleFileList as $file) {
+        $files = glob($moduleDir . '*/*/etc/module.xml');
+        foreach ($files as $file) {
             $scope = strpos($file, $mageScopePath) === 0 ? 'mage' : 'custom';
-            $output[$scope][] = $file;
+            $output[$scope][] = $this->rootDirectory->getRelativePath($file);
+        }
+        $files = glob($configDir . '*/module.xml');
+        foreach ($files as $file) {
+            $output['base'][] = $this->rootDirectory->getRelativePath($file);
         }
-        $output['base'] = $this->directoryReadRoot->search('#/module.xml$#', $configDir);
-
         return $this->iteratorFactory->create(
-            $this->directoryReadRoot,
+            $this->rootDirectory,
             array_merge($output['mage'], $output['custom'], $output['base'])
         );
     }
diff --git a/lib/Magento/View/Design/Theme/Validator.php b/lib/Magento/View/Design/Theme/Validator.php
index a731c9ace95997bddca033e0078b31cec23963c6..05ff1d576f479ab6fe38a4e01a26293b555b35cd 100644
--- a/lib/Magento/View/Design/Theme/Validator.php
+++ b/lib/Magento/View/Design/Theme/Validator.php
@@ -68,7 +68,7 @@ class Validator
                   'message' => __('Field can\'t be empty')),
             array('name' => 'available', 'class' => 'Zend_Validate_Regex', 'break' => true,
                   'options' => array('pattern' => '/^(\d+\.\d+\.\d+\.\d+(\-[a-zA-Z0-9]+)?)$|^\*$/'),
-                  'message' => __('Theme version has not compatible format'))
+                  'message' => __('Theme version has not compatible format.'))
         );
 
         $this->addDataValidators('theme_version', $versionValidators);
diff --git a/lib/Magento/View/FileSystem.php b/lib/Magento/View/FileSystem.php
index 091e4ddb22e335a29c10eea2a4137551bfa73085..da898555385c0a1f31231d26604a821725d0a851 100644
--- a/lib/Magento/View/FileSystem.php
+++ b/lib/Magento/View/FileSystem.php
@@ -62,7 +62,7 @@ class FileSystem
      */
     public function getFilename($fileId, array $params = array())
     {
-        $filePath = $this->_viewService->extractScope($fileId, $params);
+        $filePath = $this->_viewService->extractScope($this->normalizePath($fileId), $params);
         $this->_viewService->updateDesignParams($params);
         return $this->_resolutionPool->getFileStrategy(!empty($params['skipProxy']))
             ->getFile($params['area'], $params['themeModel'], $filePath, $params['module']);
@@ -92,7 +92,7 @@ class FileSystem
      */
     public function getViewFile($fileId, array $params = array())
     {
-        $filePath = $this->_viewService->extractScope($fileId, $params);
+        $filePath = $this->_viewService->extractScope($this->normalizePath($fileId), $params);
         $this->_viewService->updateDesignParams($params);
         $skipProxy = isset($params['skipProxy']) && $params['skipProxy'];
         return $this->_resolutionPool->getViewStrategy($skipProxy)->getViewFile($params['area'],
@@ -113,7 +113,7 @@ class FileSystem
         $strategy = $this->_resolutionPool->getViewStrategy($skipProxy);
         if ($strategy instanceof \Magento\View\Design\FileResolution\Strategy\View\NotifiableInterface) {
             /** @var $strategy \Magento\View\Design\FileResolution\Strategy\View\NotifiableInterface  */
-            $filePath = $this->_viewService->extractScope($fileId, $params);
+            $filePath = $this->_viewService->extractScope($this->normalizePath($fileId), $params);
             $this->_viewService->updateDesignParams($params);
             $strategy->setViewFilePathToMap(
                 $params['area'], $params['themeModel'], $params['locale'], $params['module'], $filePath, $targetPath
@@ -122,4 +122,29 @@ class FileSystem
 
         return $this;
     }
+
+    /**
+     * Remove unmeaning path chunks from path
+     *
+     * @param string $path
+     * @return string
+     */
+    public function normalizePath($path)
+    {
+        $parts = explode('/', $path);
+        $result = array();
+
+        foreach ($parts as $part) {
+            if ('..' === $part) {
+                if (!count($result) || ($result[count($result) - 1] == '..')) {
+                    $result[] = $part;
+                } else {
+                    array_pop($result);
+                }
+            } else if ('.' !== $part) {
+                $result[] = $part;
+            }
+        }
+        return implode('/', $result);
+    }
 }
diff --git a/lib/Magento/View/Layout/File/Source/Base.php b/lib/Magento/View/Layout/File/Source/Base.php
index ed9c7c6c1c1a5ed871c695696f672df3c669f78b..10512fe978c84adc4560f4b3a50901a437fbcd27 100644
--- a/lib/Magento/View/Layout/File/Source/Base.php
+++ b/lib/Magento/View/Layout/File/Source/Base.php
@@ -68,22 +68,12 @@ class Base implements SourceInterface
     {
         $namespace = $module = '*';
         $area = $theme->getArea();
-        $patternForSearch = str_replace(
-            array('/', '\*'),
-            array('\/', '[\S]+'),
-            preg_quote("~{$namespace}/{$module}/view/{$area}/layout/{$filePath}.xml~")
-        );
-        $files = $this->modulesDirectory->search($patternForSearch);
-        foreach ($files as $key => $file) {
-            $files[$key] = $this->modulesDirectory->getAbsolutePath($file);
-        }
-        $pattern = "#(?<namespace>[^/]+)/(?<module>[^/]+)/view/"
-            . preg_quote($area)
-            . "/layout/"
-            . preg_quote(rtrim($filePath, '*'))
-            . "[^/]*\.xml$#i";
+        $files = $this->modulesDirectory->search("$namespace/$module/view/{$area}/layout/{$filePath}.xml");
         $result = array();
-        foreach ($files as $filename) {
+        $filePath = strtr(preg_quote($filePath), array('\*' => '[^/]+'));
+        $pattern = "#(?<namespace>[^/]+)/(?<module>[^/]+)/view/{$area}/layout/" . $filePath . "\.xml$#i";
+        foreach ($files as $file) {
+            $filename = $this->modulesDirectory->getAbsolutePath($file);
             if (!preg_match($pattern, $filename, $matches)) {
                 continue;
             }
diff --git a/lib/Magento/View/Layout/File/Source/Override/Base.php b/lib/Magento/View/Layout/File/Source/Override/Base.php
index dc1a22ea967189884053a9fd00b072ff420c007f..c5d8db3c84d2bd5e453d7bce1365da26e5777363 100644
--- a/lib/Magento/View/Layout/File/Source/Override/Base.php
+++ b/lib/Magento/View/Layout/File/Source/Override/Base.php
@@ -68,21 +68,14 @@ class Base implements SourceInterface
     {
         $namespace = $module = '*';
         $themePath = $theme->getFullPath();
-        $patternForSearch = str_replace(
-            array('/', '\*'),
-            array('\/', '[\S]+'),
-            preg_quote("~{$themePath}/{$namespace}_{$module}/layout/override/base/{$filePath}.xml~")
-        );
-        $files = $this->themesDirectory
-            ->search($patternForSearch);
-        foreach ($files as $key => $file) {
-            $files[$key] = $this->themesDirectory->getAbsolutePath($file);
-        }
+        $searchPattern = "{$themePath}/{$namespace}_{$module}/layout/override/base/{$filePath}.xml";
+        $files = $this->themesDirectory->search($searchPattern);
         $result = array();
-        $pattern = "#/(?<moduleName>[^/]+)/layout/override/base/"
-            . preg_quote(rtrim($filePath, '*'))
-            . "[^/]*\.xml$#i";
-        foreach ($files as $filename) {
+        $pattern = "#(?<moduleName>[^/]+)/layout/override/base/"
+            . strtr(preg_quote($filePath), array('\*' => '[^/]+'))
+            . "\.xml$#i";
+        foreach ($files as $file) {
+            $filename = $this->themesDirectory->getAbsolutePath($file);
             if (!preg_match($pattern, $filename, $matches)) {
                 continue;
             }
diff --git a/lib/Magento/View/Layout/File/Source/Override/Theme.php b/lib/Magento/View/Layout/File/Source/Override/Theme.php
index 57dd6c020022a82bc14deb6f99878d75e8dd024e..fe09cb1985c501316b016bfcdda352c91e360d2c 100644
--- a/lib/Magento/View/Layout/File/Source/Override/Theme.php
+++ b/lib/Magento/View/Layout/File/Source/Override/Theme.php
@@ -27,6 +27,7 @@ namespace Magento\View\Layout\File\Source\Override;
 use Magento\View\Layout\File\SourceInterface;
 use Magento\View\Design\ThemeInterface;
 use Magento\Filesystem;
+use Magento\Filesystem\Directory\ReadInterface;
 use Magento\View\Layout\File\Factory;
 use Magento\Exception;
 
@@ -36,9 +37,9 @@ use Magento\Exception;
 class Theme implements SourceInterface
 {
     /**
-     * @var Filesystem
+     * @var ReadInterface
      */
-    private $filesystem;
+    protected $themesDirectory;
 
     /**
      * @var Factory
@@ -53,7 +54,7 @@ class Theme implements SourceInterface
         Filesystem $filesystem,
         Factory $fileFactory
     ) {
-        $this->filesystem = $filesystem;
+        $this->themesDirectory = $filesystem->getDirectoryRead(Filesystem::THEMES);
         $this->fileFactory = $fileFactory;
     }
 
@@ -69,13 +70,8 @@ class Theme implements SourceInterface
     {
         $namespace = $module = '*';
         $themePath = $theme->getFullPath();
-        $patternForSearch = str_replace(
-            array('/', '\*'),
-            array('\/', '[\S]+'),
-            preg_quote("~{$themePath}/{$namespace}_{$module}/layout/override/theme/*/{$filePath}.xml~")
-        );
-
-        $files = $this->filesystem->getDirectoryRead(Filesystem::THEMES)->search($patternForSearch);
+        $searchPattern = "{$themePath}/{$namespace}_{$module}/layout/override/theme/*/{$filePath}.xml";
+        $files = $this->themesDirectory->search($searchPattern);
 
         if (empty($files)) {
             return array();
@@ -86,12 +82,12 @@ class Theme implements SourceInterface
         while ($currentTheme = $currentTheme->getParentTheme()) {
             $themes[$currentTheme->getCode()] = $currentTheme;
         }
-
         $result = array();
-        $pattern = "#(?<module>[^/]+)/layout/override/theme/(?<themeName>[^/]+)/"
-            . preg_quote(rtrim($filePath, '*'))
-            . "[^/]*\.xml$#i";
-        foreach ($files as $filename) {
+        $pattern = "#/(?<module>[^/]+)/layout/override/theme/(?<themeName>[^/]+)/"
+            . strtr(preg_quote($filePath), array('\*' => '[^/]+'))
+            . "\.xml$#i";
+        foreach ($files as $file) {
+            $filename = $this->themesDirectory->getAbsolutePath($file);
             if (!preg_match($pattern, $filename, $matches)) {
                 continue;
             }
diff --git a/lib/Magento/View/Layout/File/Source/Theme.php b/lib/Magento/View/Layout/File/Source/Theme.php
index 2190eef60bc01f60f815a1c1a411070327ce75ae..463152efb2211fa12e7286ab5d2ebd397d19bfd5 100644
--- a/lib/Magento/View/Layout/File/Source/Theme.php
+++ b/lib/Magento/View/Layout/File/Source/Theme.php
@@ -68,20 +68,11 @@ class Theme implements SourceInterface
     {
         $namespace = $module = '*';
         $themePath = $theme->getFullPath();
-        $patternForSearch = str_replace(
-            array('/', '\*'),
-            array('\/', '[\S]+'),
-            preg_quote("~{$themePath}/{$namespace}_{$module}/layout/{$filePath}.xml~")
-        );
-        $files = $this->themesDirectory->search($patternForSearch);
-        foreach ($files as $key => $file) {
-            $files[$key] = $this->themesDirectory->getAbsolutePath($file);
-        }
+        $files = $this->themesDirectory->search("{$themePath}/{$namespace}_{$module}/layout/{$filePath}.xml");
         $result = array();
-        $pattern = "#" . preg_quote($themePath) . "/(?<moduleName>[^/]+)/layout/"
-            . preg_quote(rtrim($filePath, '*'))
-            . "[^/]*\.xml$#i";
-        foreach ($files as $filename) {
+        $pattern = "#/(?<moduleName>[^/]+)/layout/" . strtr(preg_quote($filePath), array('\*' => '[^/]+')) . "\.xml$#i";
+        foreach ($files as $file) {
+            $filename = $this->themesDirectory->getAbsolutePath($file);
             if (!preg_match($pattern, $filename, $matches)) {
                 continue;
             }
diff --git a/lib/Magento/View/Publisher.php b/lib/Magento/View/Publisher.php
index f19884542be9da1668af15fa4a957074dcc8f3eb..9cc5c3eb0fa879cedc9118a8b6ce9cd134357976 100644
--- a/lib/Magento/View/Publisher.php
+++ b/lib/Magento/View/Publisher.php
@@ -188,6 +188,8 @@ class Publisher implements \Magento\View\PublicFilesManagerInterface
      */
     protected function _publishFile($filePath, $params, $sourcePath)
     {
+        $filePath = $this->_viewFileSystem->normalizePath($filePath);
+        $sourcePath = $this->_viewFileSystem->normalizePath($sourcePath);
         $targetPath = $this->_buildPublishedFilePath($filePath, $params, $sourcePath);
 
         /* Validate whether file needs to be published */
@@ -271,7 +273,7 @@ class Publisher implements \Magento\View\PublicFilesManagerInterface
         }
 
         return ($this->_viewService->getAppMode() == \Magento\App\State::MODE_DEVELOPER)
-            && $this->_getExtension($filePath) == self::CONTENT_TYPE_CSS;
+        && $this->_getExtension($filePath) == self::CONTENT_TYPE_CSS;
     }
 
     /**
@@ -354,7 +356,12 @@ class Publisher implements \Magento\View\PublicFilesManagerInterface
             return $relatedPathPublic;
         };
         try {
-            $content = $this->_cssUrlResolver->replaceCssRelativeUrls($content, $sourcePath, $publicPath, $callback);
+            $content = $this->_cssUrlResolver->replaceCssRelativeUrls(
+                $content,
+                $this->_viewFileSystem->normalizePath($sourcePath),
+                $this->_viewFileSystem->normalizePath($publicPath),
+                $callback
+            );
         } catch (\Magento\Exception $e) {
             $this->_logger->logException($e);
         }
@@ -384,7 +391,7 @@ class Publisher implements \Magento\View\PublicFilesManagerInterface
     protected function _getRelatedViewFile($fileId, $parentFilePath, $parentFileName, &$params)
     {
         if (strpos($fileId, \Magento\View\Service::SCOPE_SEPARATOR)) {
-            $filePath = $this->_viewService->extractScope($fileId, $params);
+            $filePath = $this->_viewService->extractScope($this->_viewFileSystem->normalizePath($fileId), $params);
         } else {
             /* Check if module file overridden on theme level based on _module property and file path */
             $themesPath = $this->_filesystem->getPath(\Magento\Filesystem::THEMES);
diff --git a/lib/Magento/View/Url.php b/lib/Magento/View/Url.php
index 8eb2fd1edc199e8cb98b24c9bb6f3448415e71b5..89de152d2f9152674fd9def8d389d8591a6c9502 100644
--- a/lib/Magento/View/Url.php
+++ b/lib/Magento/View/Url.php
@@ -71,6 +71,11 @@ class Url
      */
     protected $_fileUrlMap;
 
+    /**
+     * @var \Magento\View\FileSystem
+     */
+    protected $_viewFileSystem;
+
     /**
      * @param \Magento\Filesystem $filesystem
      * @param \Magento\UrlInterface $urlBuilder
@@ -78,6 +83,7 @@ class Url
      * @param Service $viewService
      * @param Publisher $publisher
      * @param DeployedFilesManager $deployedFileManager
+     * @param \Magento\View\FileSystem $viewFileSystem,
      * @param array $fileUrlMap
      */
     public function __construct(
@@ -87,6 +93,7 @@ class Url
         \Magento\View\Service $viewService,
         \Magento\View\Publisher $publisher,
         \Magento\View\DeployedFilesManager $deployedFileManager,
+        \Magento\View\FileSystem $viewFileSystem,
         array $fileUrlMap = array()
     ) {
         $this->_filesystem = $filesystem;
@@ -95,6 +102,7 @@ class Url
         $this->_viewService = $viewService;
         $this->_publisher = $publisher;
         $this->_deployedFileManager = $deployedFileManager;
+        $this->_viewFileSystem = $viewFileSystem;
         $this->_fileUrlMap = $fileUrlMap;
     }
 
@@ -129,7 +137,7 @@ class Url
     public function getViewFilePublicPath($fileId, array $params = array())
     {
         $this->_viewService->updateDesignParams($params);
-        $filePath = $this->_viewService->extractScope($fileId, $params);
+        $filePath = $this->_viewService->extractScope($this->_viewFileSystem->normalizePath($fileId), $params);
 
         $publicFilePath = $this->_getFilesManager()->getPublicFilePath($filePath, $params);
 
@@ -152,11 +160,11 @@ class Url
             if (strpos($publicFilePath, $dir) === 0) {
                 $relativePath = ltrim(substr($publicFilePath, strlen($dir)), '\\/');
                 $url = $this->_urlBuilder->getBaseUrl(
-                    array(
-                        '_type' => $urlMap['key'],
-                        '_secure' => $isSecure
-                    )
-                ) . $relativePath;
+                        array(
+                            '_type' => $urlMap['key'],
+                            '_secure' => $isSecure
+                        )
+                    ) . $relativePath;
 
                 if ($this->_isStaticFilesSigned() && $this->_viewService->isViewFileOperationAllowed()) {
                     $directory = $this->_filesystem->getDirectoryRead(\Magento\Filesystem::ROOT);
diff --git a/lib/Magento/View/Url/CssResolver.php b/lib/Magento/View/Url/CssResolver.php
index 8729b563d74820c64f516e5acffccfef7c851daf..2f665b96ca6a2c3814afd674b1b7f6406605be3e 100644
--- a/lib/Magento/View/Url/CssResolver.php
+++ b/lib/Magento/View/Url/CssResolver.php
@@ -40,13 +40,21 @@ class CssResolver
      */
     protected $filesystem;
 
+    /**
+     * @var \Magento\View\FileSystem
+     */
+    protected $viewFileSystem;
+
     /**
      * @param \Magento\Filesystem $filesystem
+     * @param \Magento\View\FileSystem $viewFileSystem
      */
     public function __construct(
-        \Magento\Filesystem $filesystem
+        \Magento\Filesystem $filesystem,
+        \Magento\View\FileSystem $viewFileSystem
     ) {
         $this->filesystem = $filesystem;
+        $this->viewFileSystem = $viewFileSystem;
     }
 
     /**
@@ -62,6 +70,8 @@ class CssResolver
      */
     public function replaceCssRelativeUrls($cssContent, $originalPath, $newPath, $cbRelUrlToPublicPath = null)
     {
+        $originalPath = $this->viewFileSystem->normalizePath($originalPath);
+        $newPath = $this->viewFileSystem->normalizePath($newPath);
         $relativeUrls = $this->_extractCssRelativeUrls($cssContent);
         foreach ($relativeUrls as $urlNotation => $originalRelativeUrl) {
             if ($cbRelUrlToPublicPath) {
@@ -69,9 +79,9 @@ class CssResolver
             } else {
                 $filePath = dirname($originalPath) . '/' . $originalRelativeUrl;
             }
-            $filePath = $this->_normalizePath(str_replace('\\', '/', $filePath));
+            $filePath = $this->viewFileSystem->normalizePath(str_replace('\\', '/', $filePath));
             $relativePath = $this->_getFileRelativePath(
-                $this->_normalizePath(str_replace('\\', '/', $newPath)), $filePath
+                str_replace('\\', '/', $newPath), $filePath
             );
             $urlNotationNew = str_replace($originalRelativeUrl, $relativePath, $urlNotation);
             $cssContent = str_replace($urlNotation, $urlNotationNew, $cssContent);
@@ -79,31 +89,6 @@ class CssResolver
         return $cssContent;
     }
 
-    /**
-     * Remove unmeaning path chunks from path
-     *
-     * @param string $path
-     * @return string
-     */
-    protected function _normalizePath($path)
-    {
-        $parts = explode('/', $path);
-        $result = array();
-
-        foreach ($parts as $part) {
-            if ('..' === $part) {
-                if (!count($result) || ($result[count($result) - 1] == '..')) {
-                    $result[] = $part;
-                } else {
-                    array_pop($result);
-                }
-            } else if ('.' !== $part) {
-                $result[] = $part;
-            }
-        }
-        return implode('/', $result);
-    }
-
     /**
      * Extract non-absolute URLs from a CSS content
      *
diff --git a/pub/lib/mage/deletable-item.js b/pub/lib/mage/deletable-item.js
index 3f45b77e1b2f06a8110352b5d5b6800c77dc3ba6..5e8bd091e42f545569ce25e1de8a043dcb0cd40b 100644
--- a/pub/lib/mage/deletable-item.js
+++ b/pub/lib/mage/deletable-item.js
@@ -31,7 +31,8 @@
     $.widget('mage.deletableItem', {
         options: {
             deleteEvent: 'click',
-            deleteSelector: '[data-role="delete"]'
+            deleteSelector: '[data-role="delete"]',
+            hiddenClass: 'hidden'
         },
 
         /**
@@ -77,7 +78,7 @@
          * @private
          */
         _onHideDelete: function () {
-            this.element.find(this.options.deleteSelector).hide();
+            this.element.find(this.options.deleteSelector).addClass(this.options.hiddenClass);
         },
 
         /**
@@ -85,7 +86,7 @@
          * @private
          */
         _onShowDelete: function () {
-            this.element.find(this.options.deleteSelector).show();
+            this.element.find(this.options.deleteSelector).removeClass(this.options.hiddenClass);
         }
     });
 })(jQuery);
\ No newline at end of file