fixed bug in derivatives with unit conversions