Fix silly bug with gid lookup