Output working except for certain errors