Previous failure fixed, added more unit tests