test cases; with fixes