Fixed some output ordering issues