Added errorExit function that prints an error to sys.stderr and exits