clean up dangling switch code; adding new test case