ForwardDiff error "Cannot determine ordering of Dual tags" when differentiating distributed function with closure

This issue is documented in #320 in ForwardDiff. I’ve managed to work around it by avoiding closures and non-Base types in function calls.