Replace undef characters