Added error checking for replace all

Bug with charge column