Fixed the toJSON so that it now functions properly at compile time.