Fixed some bugs when separating the features into
TRAIN and TEST groups