Minor bug fix to catch null cursors