Moving printing of error into terminal.