Added test that unused global ids are removed.