Added test to excercise auto register bug and ensure it is fixed.