Fixes for white space and change the way that we perform replacements