Fixed some redundancy, added more to test.