Fixes COOK-2935. Thx to #40 and @cdimartino