Added unit test for nested rules.