Fixed the incorrect test case and the associated bugs