Fixed small bug in trainer