Tweaks to test cases + fixed some bugs with empty groups