Fix bug in toJSON method
Fix bug, 100% coverage