Fixed documentation, added more tests