Fixed a typo in output and ordering.