Created the "cursor" type and fixed some bugs