Minor bug fix to prevent error notices appearing #10832