Number of errors should be returned

Change-Id: I9036e251c36fe0eab82ab061f25ee0e6d63c120f