Pull in more of the logic from debbugs. Still not working.