Fix nudge function.  Add nudge tests.