On expandability of models of arithmetic and set theory to models of weak second-order theories