Changed the default number of iterations to 50. Everything seems to work OK. Can probably still tune thee APG algorithm better.