diff --git a/alias/hosting_alias.module b/alias/hosting_alias.module
index ce3a1f1..0211f20 100644
--- a/alias/hosting_alias.module
+++ b/alias/hosting_alias.module
@@ -493,7 +493,7 @@ function hosting_alias_settings($form, &$form_state) {
  * Validation handler for hosting_alias_settings form.
  */
 function hosting_alias_settings_validate($form, $form_state) {
-  if (!empty($form_state['values']['hosting_alias_subdomain']) && !valid_url($form_state['values']['hosting_alias_subdomain'])) {
+  if (!valid_url($form_state['values']['hosting_alias_subdomain'])) {
     form_set_error('hosting_alias_subdomain', t('The provided domain is invalid.'));
   }
 }
diff --git a/package/hosting_package.drush.inc b/package/hosting_package.drush.inc
index 60b686f..74ce540 100644
--- a/package/hosting_package.drush.inc
+++ b/package/hosting_package.drush.inc
@@ -9,6 +9,26 @@ function drush_hosting_package_pre_hosting_task() {
   if ($task->ref->type == 'site') {
     // populate the profile option, if it hasn't been specified yet.
     if (empty($task->options['profile'])) {
+
+      // If site node "profile_name" property is a string and not empty, lookup
+      // the profile package NID and save it to the site node.
+      if (empty($task->ref->profile) && !empty($task->ref->profile_name) && is_string($task->ref->profile_name)) {
+        $instances = hosting_package_instances_load(array(
+          'i.rid' => $task->ref->platform,
+          'p.package_type' => 'profile',
+          'p.short_name' => $task->ref->profile_name,
+        ));
+        $task->ref->profile = current($instances)->package_id;
+        $task->ref->no_verify = TRUE;
+        node_save($task->ref);
+
+        drush_log(dt('Updated site node !nid with install profile "!profile" with package ID !package_id.', array(
+          '!nid' => $task->ref->nid,
+          '!profile' => $task->ref->profile_name,
+          '!package_id' => $task->ref->profile,
+        )), 'notice');
+      }
+
       $profile = node_load($task->ref->profile);
       if ($task->task_type != 'import' && $task->task_type != 'delete' && $task->task_type != 'verify') {
         $task->options['profile'] = $profile->short_name;
diff --git a/site/hosting_site.drush.inc b/site/hosting_site.drush.inc
index 88dc891..ca1398c 100644
--- a/site/hosting_site.drush.inc
+++ b/site/hosting_site.drush.inc
@@ -24,6 +24,7 @@ function hosting_hosting_site_context_options(&$task) {
     $task->options['client_email'] = $user->mail;
   }
   $task->context_options['client_name'] = $client->uname;
+  $task->options['site_install_method'] = $task->ref->install_method;
 }
 
 /**
diff --git a/site/hosting_site.nodeapi.inc b/site/hosting_site.nodeapi.inc
index f7dc81f..3c4c2fa 100644
--- a/site/hosting_site.nodeapi.inc
+++ b/site/hosting_site.nodeapi.inc
@@ -249,6 +249,65 @@ function hosting_site_insert(&$node) {
   // Provide a dummy profile, e.g. for hosting-import.
   $node->profile = isset($node->profile) ? $node->profile : 0;
 
+  // If platform NID is not defined, but platform data is available,
+  // create the platform.
+  if (empty($node->platform)
+    && !empty($node->platform_node)
+    && !empty($node->platform_node->publish_path)
+  ) {
+
+    // If a platform exists for the given path, use that.
+    $existing_platform_nid = db_select('hosting_platform', 'p')
+      ->condition('publish_path', $node->platform_node->publish_path)
+      ->fields('p', array('nid'))
+      ->execute()
+      ->fetchField();
+
+    // Use the existing platform NID.
+    if ($existing_platform_nid) {
+      $node->platform = $existing_platform_nid;
+    }
+    // Or prepare a new one.
+    else {
+
+      // If platform_status hasn't been explicitly set,
+      // assume platform status matches site status:
+      // If developer creates a site node that's disabled,
+      // the platform should be too.
+      if (empty($node->platform_node->platform_status)) {
+        $node->platform_node->platform_status = $node->site_status;
+      }
+
+      // If web_server hasn't been explicity set, use hostmaster's web server.
+      if (empty($node->platform_node->web_server)) {
+        $hostmaster = hosting_context_load('hostmaster');
+        $hostmaster_platform = node_load($hostmaster->platform);
+        $node->platform_node->web_server = $hostmaster_platform->nid;
+      }
+
+      // If platform title has not been set, generate one from the site title.
+      if (empty($node->platform_node->title)) {
+        $node->platform_node->title = 'platform_' . preg_replace("/[!\W]/", "", $node->title);
+      }
+
+      // If platform UID has not been set, use site UID.
+      if (empty($node->platform_node->uid)) {
+        $node->platform_node->uid = $node->uid;
+      }
+
+      $node->platform_node->type = 'platform';
+      if ($node->platform_node = node_submit($node->platform_node)) {
+          node_save($node->platform_node);
+      }
+      $node->platform = $node->platform_node->nid;
+    }
+  }
+
+  // If there is no platform NID and no publish path, throw an exception.
+  if (empty($node->platform) && empty($node->platform_node->publish_path)) {
+    throw new Exception('Site nodes require either platform or platform_node->publish_path property');
+  }
+
   $id = db_insert('hosting_site')
     ->fields(array(
       'vid' => $node->vid,
diff --git a/web_server/hosting_web_server.service.inc b/web_server/hosting_web_server.service.inc
index 75aa443..fed9889 100644
--- a/web_server/hosting_web_server.service.inc
+++ b/web_server/hosting_web_server.service.inc
@@ -34,11 +34,9 @@ class hostingService_http_apache extends hostingService_http_public {
 
   function default_restart_cmd() {
     $command = '/usr/sbin/apache2ctl'; # a proper default for most of the world
-    if (isset($_SERVER['PATH'])) {
-      foreach (explode(':', $_SERVER['PATH']) as $path) {
-        $options[] = "$path/apache2ctl";
-        $options[] = "$path/apachectl";
-      }
+    foreach (explode(':', $_SERVER['PATH']) as $path) {
+      $options[] = "$path/apache2ctl";
+      $options[] = "$path/apachectl";
     }
     # try to detect the apache restart command
     $options[] = '/usr/local/sbin/apachectl'; # freebsd
