Fix for advanced settings failure

@singingwolfboy Second attempt at fixing this after seeing it fail again today.  I think I've found the root cause thanks to @talbs