Fix some more issues

Also IntToHexString is rather expensive. I'd probably stick to what we had here.