Fixed bug in grammar when content ends with "$" or "%"