Fixed a bug with the cursor, which in some cases returned the wrong column id.