Corrected a logic error that caused the "each" command to crash