Cleanup of the resource IDs to ensure consistency.