Fix for propagating changes of parent rack/dc.

This pull request basically reverts some changes introduced by #1035 (some pieces of previously removed code responsible for updating rack/dc fields are brought back and slightly improved).