Fixed 'For' Loop and output for error-checking