bug fix for toJSON, v0.0.7