fixing bugs in parsing cursor-expressions