Test case + bug fixing.