Syncing with vip

Noticed a small edge case bug in code that came down from VIP, fixed that and added tests.
Yeah I was thinking that theoretically the taxonomy could push it over the limit -- I'll make @bcampeau's tweak.