Fixed.  I've also added tests, to test this method.  I'm not sure that I picked a very good file name for the tests...