Fix output matching code