Fix typo in complex parsing code; expand tests.