Fixed some output bugs.