Fixed test cases. General polish up.