Correct memory management for Inputs.