Fix bug on isEmpty verification