Complete rewritten `set` method. `saveObject` method is depracated now.