Fixed differentiation function. Added more tests. Added TODO.