Replaced isEmpty() calls