Cursor and logging improvements