Re-added previously removed code, with unit-test to prove it's required