fixed isEmpty() core Model function.