Fix a bug with IDs
Fix more bugs