Fixed linking issues, see blog for details, and cleaned up conversion code.