Committed wrong code last time. Fix for issue 2638 - datatype not respected on destroy