Avoid perl undef warning by setting undef data to 0