Adding error count to sample program.