Handled exceptions in train; Added tests