Fixed dual methods to support eta

In particular the function definition and gradient. Still need to convert ts2W and friends.