Fixed broken entity toJSON spec