Bugfix with autoincrement