Fixed some train bugs, added testing methods