Remove debug code.
Fix problem where option was being permanently screwed up because of assignments passed by reference.
Merge pull request #349 from jrogelstad/20212

Fix toJSON problem.