Added a training interface and fixed a message bug.