Fixes (some of which may be hacks) to get Alex's code running again