Merging Jeff's changes to Brennan's fork.