Changed the JSON "tpe" field to "$type" and fixed the tests.