Fixing some converting bugs.