Added tests and fixed whitespace preventing null replacing []
actually added tests (didn't do git add last time)