diff --git a/compact_forms.module b/compact_forms.module
index 6993f79..1a2e476 100644
--- a/compact_forms.module
+++ b/compact_forms.module
@@ -46,6 +46,15 @@ function compact_forms_menu() {
  * Implements hook_form_alter().
  */
 function compact_forms_form_alter(&$form, $form_state, $form_id) {
+  $form['#pre_render'][] = 'compact_forms_pre_render';
+}
+
+/**
+ * #pre_render callback for all forms.
+ *
+ * @todo Replace with #attached and move back into hook_form_alter().
+ */
+function compact_forms_pre_render($form) {
   static $css_ids, $form_ids, $loaded, $field_size, $descriptions;
 
   // Prepare CSS form ids.
@@ -66,7 +75,7 @@ function compact_forms_form_alter(&$form, $form_state, $form_id) {
     $descriptions = variable_get('compact_forms_descriptions', 1);
   }
 
-  if (in_array($form_id, $form_ids) || (isset($form['#id']) && in_array($form['#id'], $css_ids))) {
+  if (in_array($form['form_id']['#value'], $form_ids) || (isset($form['#id']) && in_array($form['#id'], $css_ids))) {
     // If the custom #compact_forms property has been programmatically set to
     // FALSE, do not process this form.
     if (isset($form['#compact_forms']) && !$form['#compact_forms']) {
@@ -90,6 +99,7 @@ function compact_forms_form_alter(&$form, $form_state, $form_id) {
       _compact_forms_resize_fields($form, $field_size, $descriptions);
     }
   }
+  return $form;
 }
 
 /**
