NRE in cursor parser

I think the cursor logic really needs to be revamped. Some of the use
cases I'm seeing are just killing any attempt at parsing.