The first patch is a rewrite of ajax's original patch taking Jamey's comments into a/c. I'd appreciate a logic review to make sure its doing the what I think it is. The following four patches are just some of the fixes from an internal coverity run done by Red Hat. Dave.