Added getErrorsAsObject method.