Shouldn't we check if gid is an Integer as well?