Fix bug in misunderstanding emptly flag handling