Better fix for auto-incrementing indices