Fix formatting & make testcase pass consistently