Fixes bug in page restricted status inheritance.

This fixes an issue when the restricted status was set to false, the children doesn't inherit this state.
It also ensures that the children always inherit the restricted state not only on changing the state.