Variations on the nerve theorem