Merged -r4560:4627 from jcorgan/ticket-39 into trunk. Fixes ticket:39.