Improve NoticeHandler::getVisibleNotices() implementation

Closes #1729