Fixed bug generating autoincrement column