fix derivative parsing bug