Match training parameters with that of optimize()
Merge branch 'master'
A few minor changes to train()
Merge branch 'master'