Fix segfault if 'each' command is not followed by another command