Index: nodetable_input/nodetable_input.module
===================================================================
--- nodetable_input/nodetable_input.module	(revision 120)
+++ nodetable_input/nodetable_input.module	(working copy)
@@ -35,12 +35,13 @@
  * Process a piece of text to embed a nodetable table.
  */
 function nodetable_filter_process($text) {
-  $pattern = "/\[nodetable:(\d+)\]/i";
+  $pattern = "/\[nodetable:\s*(\d+)\]/i";
   if (preg_match_all($pattern, $text, $matches)) {
     foreach ($matches[1] as $key => $match) {
       if (is_numeric($match)) { // ID of the table.
         $table_node = node_load($match);
         if (isset($table_node->table)) { // @TODO: Check this on node validation.
+          $headers = array();
           foreach ($table_node->table->header as $header) {
             $headers[] = $header;
           }
