test case, plus a few tweaks