Fix for #1169 incorrect count of the number of errors
Test for #1169: incorrect count of the number of errors