[FIX] Fixed wrong Cursor state while getting max id from table.