Added some more error checking to replacechar