Protection against empty inputs.