Fix single-character bug, add nested rules test