Fixed copy-and-paste issues caught by unit test cases