Fix nil issue for replacement, and concat operations.