it's hard to find one thing i know for certain!
it's just a typo. the partial derivative of logq with respect to a is 'log(z)' instead of 'long(z)'.
sorry i may appear too excited, but this world is full of uncertainties! a typo is one of the few only exceptions.