Fixed issue #131. Sp type is always 'train' when editing sp.