Make set method more flexible.