Issue 1559 and typo fix

Had the same JSON deserialization problem as in issue 1559; now that it's fixed, I had a look at the code and noticed that test code was left in.

Also, small typo fix.