fix json serialization (Closes: #943)