Possible fix for D[Cos[t],t] behaviour