Bug fix, test case addition and restructure. See README