patch up @tianon's code
patch up @tianon's code

paultag/moxie,mileswwatkins/moxie,loandy/moxie,loandy/moxie,mileswwatkins/moxie,rshorey/moxie,paultag/moxie,paultag/moxie,mileswwatkins/moxie,rshorey/moxie,loandy/moxie,rshorey/moxie