More adjustments. Tests nearly pass now.