Added test cases. Some very minor changes/ fix.