Fixed JSON serilizer when dealing with rational numbers