Improved id handling.