Fix a bug in extracting features