Fixed a small crash with cursor not properly checking for empty.