Fixed so that 'toLocaleString' is overridden properly

Not sure how the code got like this. If you run the unit tests on the main repo without this merge, tests relating to `toLocaleString` will fail. This is because the condition when `toLocaleString` is overridden is incorrect.

This is sort of related to #58, latest comment.

@caridy @ericf