diff --git a/src/plugins/mactime/mactime.c b/src/plugins/mactime/mactime.c
index 6cbddbc..1b053fa 100644
--- a/src/plugins/mactime/mactime.c
+++ b/src/plugins/mactime/mactime.c
@@ -126,6 +126,8 @@
       else if (unformat (input, "%U", unformat_vnet_sw_interface,
 			 mm->vnet_main, &sw_if_index))
 	;
+      else if (unformat (input, "sw_if_index %d", &sw_if_index))
+	;
       else
 	break;
     }
@@ -145,11 +147,6 @@
 	(0, "Invalid interface, only works on physical ports");
       break;
 
-    case VNET_API_ERROR_UNIMPLEMENTED:
-      return clib_error_return (0,
-				"Device driver doesn't support redirection");
-      break;
-
     default:
       return clib_error_return (0, "mactime_enable_disable returned %d", rv);
     }
diff --git a/src/plugins/unittest/CMakeLists.txt b/src/plugins/unittest/CMakeLists.txt
index 8e8142d..5b7e1f7 100644
--- a/src/plugins/unittest/CMakeLists.txt
+++ b/src/plugins/unittest/CMakeLists.txt
@@ -25,6 +25,7 @@
   fib_test.c
   ipsec_test.c
   interface_test.c
+  mactime_test.c
   mfib_test.c
   punt_test.c
   rbtree_test.c
diff --git a/src/plugins/unittest/mactime_test.c b/src/plugins/unittest/mactime_test.c
new file mode 100644
index 0000000..907022f
--- /dev/null
+++ b/src/plugins/unittest/mactime_test.c
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2015 Cisco and/or its affiliates.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <vlib/vlib.h>
+#include <vppinfra/time_range.h>
+
+static int
+test_time_range_main (unformat_input_t * input)
+{
+  clib_timebase_t _tb, *tb = &_tb;
+  clib_timebase_component_t _c, *cp = &_c;
+  clib_timebase_range_t *rp = 0;
+  clib_timebase_range_t *this_rp;
+  unformat_input_t _input2, *input2 = &_input2;
+  char *test_range_string;
+  f64 sunday_midnight;
+  f64 now, then;
+  f64 start_time, end_time;
+  f64 timezone_offset;
+
+  /* Init time base */
+  clib_timebase_init (tb, -5 /* EST */ , CLIB_TIMEBASE_DAYLIGHT_USA);
+
+  /* Set up summer time cache */
+  now = clib_timebase_now (tb);
+
+  /* Test it */
+  now = clib_timebase_now (tb);
+
+  /* show current time */
+  fformat (stdout, "Current time in UTC%f, US daylight time rules:\n",
+	   tb->timezone_offset / 3600.0);
+  fformat (stdout, "%U", format_clib_timebase_time, now);
+
+  /* Test conversion to component structure */
+  clib_timebase_time_to_components (now, cp);
+  now = clib_timebase_components_to_time (cp);
+  fformat (stdout, " -> %U\n", format_clib_timebase_time, now);
+
+  /*
+   * test a few other dates, to verify summer time operation
+   * 2011: started sunday 3/13, ended sunday 11/6
+   */
+
+  fformat (stdout, "Test daylight time rules:\n");
+
+  clib_memset (cp, 0, sizeof (*cp));
+
+  /* Just before DST starts */
+  cp->year = 2011;
+  cp->month = 2;
+  cp->day = 13;
+  cp->hour = 1;
+  cp->minute = 59;
+  cp->second = 59;
+  then = clib_timebase_components_to_time (cp);
+
+  timezone_offset = clib_timebase_summer_offset_fastpath (tb, then);
+
+  fformat (stdout, "%U should not be in DST, and it %s\n",
+	   format_clib_timebase_time, then,
+	   (timezone_offset != 0.0) ? "is" : "is not");
+
+  /* add two seconds */
+
+  then += 2.0;
+
+  timezone_offset = clib_timebase_summer_offset_fastpath (tb, then);
+
+  fformat (stdout, "%U should be in DST, and it %s\n",
+	   format_clib_timebase_time, then,
+	   (timezone_offset != 0.0) ? "is" : "is not");
+
+  /* Just before DST ends */
+  cp->year = 2011;
+  cp->month = 10;
+  cp->day = 6;
+  cp->hour = 1;
+  cp->minute = 59;
+  cp->second = 59;
+  then = clib_timebase_components_to_time (cp);
+
+  timezone_offset = clib_timebase_summer_offset_fastpath (tb, then);
+
+  fformat (stdout, "%U should be in DST, and it %s\n",
+	   format_clib_timebase_time, then,
+	   (timezone_offset != 0.0) ? "is" : "is not");
+
+  /* add two seconds. */
+
+  then += 2.0;
+
+  timezone_offset = clib_timebase_summer_offset_fastpath (tb, then);
+
+  fformat (stdout, "%U should not be in DST, and it %s\n",
+	   format_clib_timebase_time, then,
+	   (timezone_offset != 0.0) ? "is" : "is not");
+
+  /* Back to the future... */
+  clib_timebase_time_to_components (now, cp);
+
+  fformat (stdout, "Test time range calculations:\n");
+
+  /* Find previous Sunday midnight */
+  sunday_midnight = now = clib_timebase_find_sunday_midnight (now);
+
+  clib_timebase_time_to_components (now, cp);
+
+  fformat (stdout, "Sunday midnight: %U\n", format_clib_timebase_time, now);
+
+  test_range_string = "Mon 11 - 17 Tue 7 - 11 Wed - Fri 8 - 18";
+
+  unformat_init_string (input2, test_range_string,
+			strlen (test_range_string));
+
+  if (unformat (input2, "%U", unformat_clib_timebase_range_vector, &rp))
+    {
+      vec_foreach (this_rp, rp)
+      {
+	start_time = sunday_midnight + this_rp->start;
+	end_time = sunday_midnight + this_rp->end;
+	fformat (stdout, "range: %U - %U\n",
+		 format_clib_timebase_time, start_time,
+		 format_clib_timebase_time, end_time);
+      }
+      vec_free (rp);
+    }
+  else
+    {
+      fformat (stdout, "Time convert fail!\n");
+      return -1;
+    }
+
+  unformat_free (input2);
+
+  return 0;
+}
+
+
+static clib_error_t *
+test_time_range_command_fn (vlib_main_t * vm,
+			    unformat_input_t * input,
+			    vlib_cli_command_t * cmd)
+{
+  int rv;
+
+  rv = test_time_range_main (input);
+
+  if (rv)
+    return clib_error_return (0, "test time range FAILED, error %d", rv);
+
+  return 0;
+}
+
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (test_time_range_command, static) =
+{
+  .path = "test time-range",
+  .short_help = "test time-range",
+  .function = test_time_range_command_fn,
+};
+/* *INDENT-ON* */
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */
diff --git a/src/vnet/pg/cli.c b/src/vnet/pg/cli.c
index 4526986..9c42d70 100644
--- a/src/vnet/pg/cli.c
+++ b/src/vnet/pg/cli.c
@@ -109,19 +109,26 @@
 enable_disable_stream (vlib_main_t * vm,
 		       unformat_input_t * input, vlib_cli_command_t * cmd)
 {
+  unformat_input_t _line_input, *line_input = &_line_input;
   pg_main_t *pg = &pg_main;
   int is_enable = cmd->function_arg != 0;
   u32 stream_index = ~0;
 
-  if (unformat (input, "%U", unformat_eof))
-    ;
-  else if (unformat (input, "%U", unformat_hash_vec_string,
-		     pg->stream_index_by_name, &stream_index))
-    ;
-  else
-    return clib_error_create ("unknown input `%U'",
-			      format_unformat_error, input);
+  if (!unformat_user (input, unformat_line_input, line_input))
+    goto doit;
 
+  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (line_input, "%U", unformat_hash_vec_string,
+		    pg->stream_index_by_name, &stream_index))
+	;
+      else
+	return clib_error_create ("unknown input `%U'",
+				  format_unformat_error, line_input);
+    }
+  unformat_free (line_input);
+
+doit:
   pg_enable_disable (stream_index, is_enable);
 
   return 0;
@@ -374,6 +381,10 @@
 			 unformat_vnet_sw_interface, vnm,
 			 &s.sw_if_index[VLIB_RX]))
 	;
+      else if (unformat (input, "tx-interface %U",
+			 unformat_vnet_sw_interface, vnm,
+			 &s.sw_if_index[VLIB_TX]))
+	;
 
       else if (unformat (input, "pcap %s", &pcap_file_name))
 	;
diff --git a/src/vnet/pg/input.c b/src/vnet/pg/input.c
index 39f0692..7171bbd 100644
--- a/src/vnet/pg/input.c
+++ b/src/vnet/pg/input.c
@@ -1108,7 +1108,7 @@
 	vnet_buffer (b1)->sw_if_index[VLIB_RX] = s->sw_if_index[VLIB_RX];
 
       vnet_buffer (b0)->sw_if_index[VLIB_TX] =
-	vnet_buffer (b1)->sw_if_index[VLIB_TX] = (u32) ~ 0;
+	vnet_buffer (b1)->sw_if_index[VLIB_TX] = s->sw_if_index[VLIB_TX];
 
       if (set_data)
 	{
@@ -1133,8 +1133,7 @@
 
       b0 = vlib_get_buffer (vm, bi0);
       vnet_buffer (b0)->sw_if_index[VLIB_RX] = s->sw_if_index[VLIB_RX];
-      /* s->sw_if_index[VLIB_TX]; */
-      vnet_buffer (b0)->sw_if_index[VLIB_TX] = (u32) ~ 0;
+      vnet_buffer (b0)->sw_if_index[VLIB_TX] = s->sw_if_index[VLIB_TX];
 
       if (set_data)
 	clib_memcpy_fast (b0->data, data, n_data);
@@ -1266,7 +1265,7 @@
 	  b = vlib_get_buffer (vm, buffers[current_buffer_index]);
 	  clib_memcpy_fast (b->data, d0 + data_offset, bytes_this_chunk);
 	  vnet_buffer (b)->sw_if_index[VLIB_RX] = s->sw_if_index[VLIB_RX];
-	  vnet_buffer (b)->sw_if_index[VLIB_TX] = (u32) ~ 0;
+	  vnet_buffer (b)->sw_if_index[VLIB_TX] = s->sw_if_index[VLIB_TX];
 	  b->flags = 0;
 	  b->next_buffer = 0;
 	  b->current_data = 0;
diff --git a/src/vnet/pg/stream.c b/src/vnet/pg/stream.c
index c60c584..64fe7c8 100644
--- a/src/vnet/pg/stream.c
+++ b/src/vnet/pg/stream.c
@@ -447,16 +447,16 @@
   /* Find an interface to use. */
   s->pg_if_index = pg_interface_add_or_get (pg, s->if_id);
 
-  {
-    pg_interface_t *pi = pool_elt_at_index (pg->interfaces, s->pg_if_index);
-    vlib_rx_or_tx_t rx_or_tx;
-
-    vlib_foreach_rx_tx (rx_or_tx)
+  if (s->sw_if_index[VLIB_RX] == ~0)
     {
-      if (s->sw_if_index[rx_or_tx] == ~0)
-	s->sw_if_index[rx_or_tx] = pi->sw_if_index;
+      pg_interface_t *pi = pool_elt_at_index (pg->interfaces, s->pg_if_index);
+      /*
+       * Default the RX interface if unset. It's a bad mistake to
+       * set [VLIB_TX] prior to ip lookup, since the ip lookup code
+       * interprets [VLIB_TX] as a fib index...
+       */
+      s->sw_if_index[VLIB_RX] = pi->sw_if_index;
     }
-  }
 
   /* Connect the graph. */
   s->next_index = vlib_node_add_next (vm, device_input_node.index,
diff --git a/src/vpp/api/plugin.c b/src/vpp/api/plugin.c
index 51f3461..73a20d4 100644
--- a/src/vpp/api/plugin.c
+++ b/src/vpp/api/plugin.c
@@ -177,10 +177,7 @@
 #define QUOTE_(x) #x
 #define QUOTE(x) QUOTE_(x)
 
-/*
- * Load plugins from /usr/lib/vpp_api_test_plugins by default
- */
-char *vat_plugin_path = "/usr/lib/vpp_api_test_plugins";
+extern char *vat_plugin_path;
 
 char *vat_plugin_name_filter = 0;
 
diff --git a/src/vpp/vnet/main.c b/src/vpp/vnet/main.c
index 6819ae6..5100d5c 100644
--- a/src/vpp/vnet/main.c
+++ b/src/vpp/vnet/main.c
@@ -31,6 +31,7 @@
  */
 char *vlib_plugin_path = NULL;
 char *vlib_plugin_app_version = VPP_BUILD_VER;
+char *vat_plugin_path = NULL;
 
 static void
 vpp_find_plugin_path ()
@@ -219,6 +220,11 @@
 	  if (i < (argc - 1))
 	    vlib_plugin_path = argv[++i];
 	}
+      if (!strncmp (argv[i], "test_plugin_path", 16))
+	{
+	  if (i < (argc - 1))
+	    vat_plugin_path = argv[++i];
+	}
       else if (!strncmp (argv[i], "heapsize", 8))
 	{
 	  sizep = (u8 *) argv[i + 1];
@@ -304,7 +310,7 @@
 VLIB_CONFIG_FUNCTION (heapsize_config, "heapsize");
 
 static clib_error_t *
-plugin_path_config (vlib_main_t * vm, unformat_input_t * input)
+dummy_path_config (vlib_main_t * vm, unformat_input_t * input)
 {
   u8 *junk;
 
@@ -322,8 +328,22 @@
   return 0;
 }
 
+static clib_error_t *
+plugin_path_config (vlib_main_t * vm, unformat_input_t * input)
+{
+  return dummy_path_config (vm, input);
+}
+
 VLIB_CONFIG_FUNCTION (plugin_path_config, "plugin_path");
 
+static clib_error_t *
+test_plugin_path_config (vlib_main_t * vm, unformat_input_t * input)
+{
+  return dummy_path_config (vm, input);
+}
+
+VLIB_CONFIG_FUNCTION (test_plugin_path_config, "test_plugin_path");
+
 void vl_msg_api_post_mortem_dump (void);
 void elog_post_mortem_dump (void);
 
