Rebuild method updated

- Fixed rebuild method to handle unsuccessful updates
- Fixed issues with variable editor