parser permutation unit test and fixes