Minor modifications. Added new tests and TODO.