Fixed bug in phase training.