Moved the profiles loop in drupal_get_profiles outside of the else control so that it always runs.