fix replace
Detect array of objects.

Closes #5
Merge branch 'master' into enhance_testcases