Fixed a bug in group reference resolution.