Fix segfaults from parsing certain rules