Fix period ID bug