I've cleaned it up but it still doesn't work.

Maybe use the debug output from
http://qrlogo.kaarposoft.dk/qrencode.html to figure out what the problem
is.