Output bugs fixed