fix conversion issues on complex numbers input
compact string representations of complex and rational numbers