'type' property should be whitelisted in toJSON call
Merge branch 'v0.4'