Empty array fix, Replacer test cases added