r5936: Fix bugs in earlier work in progress commit. Closer to properly supporting...