Made error counts work with new notices api Closes #4201