Fixed some Output bugs with indexing