Change of logic to serialize solution vector if only scalar variables are present. Issue #4249