Several Bug Fixes to Rule Parsing