Ensured that onlyIf is applied to anonymous rules (fixes #374)