Fixed a bug in 1-sided derivative