Update train.rb and train_spec.rb for PR