Dimension elements containing a single quote character (') require a double quote to be interpreted correctly by the rules engine.
Example: ['department's'] -> ['department''s']
One could use aliases without single quote characters too, however the rule would break if anything were to happen to these aliases. So it is best practice not to use single quote characters in your elements in the first place and if you really need them, then use the double quote in the rules.
After modifying cells through rules, the consolidations of these cells won't match the new values.
To reconciliate consolidations add in your rules:
['Total'] = ConsolidateChildren('dimension')