Ensure modifyVars does not call refresh if no variables are specified #1699