Fix feature/groundtruth loading bug

When no data was predefined, these functions gave null features and
groundtruths.
Changing the condition statement of checking global variable
predefinition to be checking the size of the var is good.